Finding whether the process is active.....

pbolaki
pbolaki used Ask the Experts™
on
Hi,

   I use _spawnl(_P_NOWAIT,.....) to execute a process, I _sleep for certain time, after the sleep loop is complete
I need to find out if the process spawned is ACTIVE or still existing.

   Can someone Please suggest a way to do this. Thanks.

Sincerely,
PAnkaj
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Commented:
Under Win32, don't spawn - CreateProcess() instead.  It will give you a handle that you can WaitForSingleObject() on the process handle (use a zero timeout just for checking and INFINITE timeout for waiting).

http://msdn.microsoft.com/library/en-us/dllproc/base/creating_processes.asp

Commented:
This question didn't show any activity for more than 21 days. I will ask Community Support to close it unless you finalize it yourself within 7 days.
You can always request to keep this question open. But remember, experts can only help if you provide feedback to their comments.
Unless there is objection or further activity,  I will suggest to accept

    "alexo"

comment(s) as an answer.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
========
Werner
Force accepted

** Mindphaser - Community Support Moderator **

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial