-
June 29th, 2001, 10:49 AM
#1
Waiting for a DOS application to terminate?
Hello.
I want to write a windows frontend for a DOS tool.
So I call the DOS app and the DOS box pops up.
Then I have to wait until it has finished
before I can proceed. But how do I know?
I tried to use FindWindow() and look periodically
for a window title with my DOS application name.
But that is e.g. different in WinNT as in Win98.
Any solutions?
BR,
DÃ*etmar
-
June 29th, 2001, 10:57 AM
#2
Re: Waiting for a DOS application to terminate?
Hi,
Use OpenProcess to get a handle to the process.
(Or use CreateProcess to create the process and to obtain the process handle)
Then use WaitForSingleObject to wait for its termination.
Bye
Peter
-
June 29th, 2001, 11:09 AM
#3
Re: Waiting for a DOS application to terminate?
Do you mean this?
WaitForSingleObject
(hHandle, // = hProcess from struct PROCESS_INFORMATION
timeout);
In Win98 the DOS box is still visible after termination.
Does this work anyway?
-
June 30th, 2001, 05:55 AM
#4
Re: Waiting for a DOS application to terminate?
Hi,
yes, it's the hProcess member of the PROCESS_INFORMATION structure.
I don't know what happens when the dos-box keeps visible. Try following:
STARTUPINFO's dwFlags contains STARTF_USESHOWWINDOW
STARTUPINFO's wShowWindow is SW_HIDE
Bye
Peter
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|