I am using CreateProcess function for creating the process, is there any option to get the current state of the process (running or not). Kindly guide me how can I make it possible.
+1
A:
Use OpenProcess
function with that dwProcessId if it returns NULL Process is not running otherwise it will return handle to that process
mihirpmehta
2010-03-25 05:00:46
Why do you call OpenProcess? It only gives you another handle to the new process, as CreateProcess already returned one.
MSalters
2010-03-25 09:21:47
I guess OpenProcess Will not create new process it will return handle only if that process is running (I am not sure...)
mihirpmehta
2010-03-25 10:08:29
+1
A:
Create process returns a handle to the process in PROCESS_INFORMATION structure, you can use this with something like GetExitCodeProcess to work out if it is still running, or you can use the wait functions to wait for it to exit.
tyranid
2010-03-25 05:56:54