Hi Guys,
I am running an external app from my prog and on some systems, its window remains open after it has finished. I don't want this to happen, so my question is: How do i ensure that the app window is closed when it finishes?
Printable View
Hi Guys,
I am running an external app from my prog and on some systems, its window remains open after it has finished. I don't want this to happen, so my question is: How do i ensure that the app window is closed when it finishes?
Hehe, I just posted a similar question. What method are you using to run the external application?Quote:
Originally posted by Blinky Bill
Hi Guys,
I am running an external app from my prog and on some systems, its window remains open after it has finished. I don't want this to happen, so my question is: How do i ensure that the app window is closed when it finishes?
This is the code i'm using
VB Code:
Public Function ExecCmd(cmdline$) Dim proc As PROCESS_INFORMATION Dim start As STARTUPINFO Dim ret& start.cb = Len(start) ret& = CreateProcessA(0&, cmdline$, 0&, 0&, 1&, NORMAL_PRIORITY_CLASS, 0&, 0&, start, proc) ret& = WaitForSingleObject(proc.hProcess, INFINITE) ret& = CloseHandle(proc.hProcess) End Function
This is courtesy of MuzzaD who provided me with it earlier today.