By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,376 Members | 1,566 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,376 IT Pros & Developers. It's quick & easy.

How to find whether the proces is running or not?

P: n/a
Hi All,
I am working on Windows platform.
Is there any way to find out whether the given process running?

( History: I am using WaitForSingleObject. People advised me the
WaitForSingleObject could hang if the process for which we are waiting
terminated earlier to calling WaitForSingleObject. So I am trying to
check whether the given process is running)
Thanks
Sabiyur

Apr 16 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Sabiyur skrev:
Hi All,
I am working on Windows platform.
Is there any way to find out whether the given process running?

( History: I am using WaitForSingleObject. People advised me the
WaitForSingleObject could hang if the process for which we are waiting
terminated earlier to calling WaitForSingleObject. So I am trying to
check whether the given process is running)

Try

http://support.microsoft.com/kb/175030

--
OU
Apr 16 '07 #2

P: n/a
On Apr 16, 8:17 pm, "Sabiyur" <SabiyurRah...@gmail.comwrote:
I am working on Windows platform.
Is there any way to find out whether the given process running?
( History: I am using WaitForSingleObject. People advised me the
WaitForSingleObject could hang if the process for which we are waiting
terminated earlier to calling WaitForSingleObject. So I am trying to
check whether the given process is running)
It depends on the system; Posix's waitpid(), for example, has a
WNOHANG option which effectively prevents blocking. On some
systems, you can set a timeout on the process wait, and setting
it to 0 effectively means to poll; this is the case for Window's
WaitForSingleObject, for example.

Otherwise, the classical solution is to spawn a separate thread,
and wait there.

--
James Kanze (GABI Software) email:ja*********@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34

Apr 17 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.