VB6: Command prompt without Close button (or X) started by VB6
Posted on 2006-04-07
in Visual Basic (VB6) Program I'm running a command prompt.
' VB6 code part:
Private Declare Function WriteConsole Lib "kernel32" _
Alias "WriteConsoleA" _
(ByVal hConsoleOutput As Long, _
ByVal lpBuffer As String, _
ByVal nNumberOfCharsToWrite As Long, _
lpNumberOfCharsWritten As Long, _
lpReserved As Any) As Long
app_name = App.Path & "\" & "Console.bat"" " & "2"
txt = "Ready to run" & vbCrLf
WriteConsole hConsole, txt, Len(txt), num_written, vbNullString
' the next line executes an application asynchronously
if "%1" == "2" goto netstat
Everything is working, but if the command prompt is closed ,
the VB6 programs gets closed too.
Now I came up with the idea to ensure that the menu point Close in the system menu
of the displayed command prompt window is disabled (or clicks are ignored).
That also means that the X (cross the the upper right corner) cannot be used.
Is there a way to do this?
If anyone can help me,
please supply appropriate information.
Thank you for any help.