cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
General C++ Programming
[solved]Process Handle in Windows
[solved]Process Handle in Windows
Oct 8, 2014 at 4:26am UTC
IamSumit
(22)
Hi all
Is there any difference b/w process handle and pid.
if so how i can get HANDLE of all processes.
Thanks
Last edited on
Oct 17, 2014 at 9:25am UTC
Oct 8, 2014 at 4:31am UTC
Duthomhas
(13212)
Alas, they are different things.
Use the "snapshot" API to enumerate all processes.
Good luck!
Oct 8, 2014 at 5:10am UTC
IamSumit
(22)
Thanks for reply.
actually i found enumprocess() to do same thing .
My motive is to get notify when any process(.exe) gets closed/quit .I need some events/signal that can notify me that this process is terminated.
is there any way ?
Oct 8, 2014 at 5:34am UTC
Duthomhas
(13212)
Unless you are writing a system-level service, you don't need to know.
Focus on the processes that 'belong' to you.
Use
http://www.google.com/search?btnI=1&q=msdn+WaitForMultipleObjects
(or the Ex version, depending on your need.)
Oct 8, 2014 at 5:34am UTC
modoran
(2077)
Yes. Call WaitForSingleObject on the process handle.
http://msdn.microsoft.com/en-us/library/windows/desktop/ms687032%28v=vs.85%29.aspx
Topic archived. No new replies allowed.