VB Code:
Private Sub ExecCmd(CmdLine As String)
[b] Const STARTF_USESHOWWINDOW As Long = &H1 [/b]
Dim proc As PROCESS_INFORMATION
Dim start As STARTUPINFO
Dim ret As Long
' Initialize the STARTUPINFO structure:
start.cb = Len(start)
[b] start.dwFlags = STARTF_USESHOWWINDOW [/b]
' Start the shelled application:
ret = CreateProcessA(0&, CmdLine, 0&, 0&, 1&, NORMAL_PRIORITY_CLASS, 0&, 0&, start, proc)
' Wait for the shelled application to finish:
ret = WaitForSingleObject(proc.hProcess, INFINITE)
ret = CloseHandle(proc.hProcess)
End Sub