
How to know the previous process whether exited?
Hi there,
CreateProcess will also return a HANDLE to the new process.
You can use one of the Wait* API's to wait for the process to finish like
this:
HANDLE hChild = CreateProces(...)
... do some work...
WaitForSingleObject(&hChild,...)
If you want to get the Exit code of the child process, use
GetExitCode(hChild)
Hope this helps,
James Wilkinson
Quote:
> Hi all:
> I have ever launched a external program with CreateProcess(). I want to
> know the process that I launched before whether exited. The processID is
> returned in CreateProcess(). Could I conclude it according to searching if
> the ProcessID exist. Is there any API function which can search the
special
> ProcessID as FindWindow(). Any advice is appreciated very much.