Mike C
"wrenashe" <wren...@gmail.com> wrote in message
news:03c65e6e-a556-4f39...@24g2000hsh.googlegroups.com...
Use the HKEY_PERFORMANCE_DATA section of the Registry.
Since a killed process's pid still exists in windows handle table, so
openprocess() fails to report its actual state. I used
CreateToolhelp32Snapshot() to list all known PIDs, and then check if
my pid(that killed one's) is in there. If there, process is running
otherwise, it is gone already. Now it seems work well.
GetExitCodeProcess?
http://msdn2.microsoft.com/en-us/library/ms683189(VS.85).aspx
If you have the handle to the process and SYNCHRONIZE access, use
WaitForSingleObject/WaitForMultipleObjects to wait for the handle. It
will be signalled as soon as the process exits.
Corinna
--
Corinna Vinschen
Cygwin Project Co-Leader
Red Hat