![]() |
Windows API: How to obtain a list of currently running processes.
Haven't posted in a while, figured I'd give you guys something from my personal code stash I've built up over the years. :) It wouldn't let me create a new thread in the tutorials section, so I've posted it here...
Here's a little piece of code that'll get the exe name for each running process. You'll need to include windows.h. :
HANDLE hSnapShot=NULL;For an example of this piece of code in action, see my process utility here: http://www.freewebs.com/wombatex/bpk.htm |
I haven't looked at you program but it sounds very similar some something I made a whill back. There is another resent thread in here that shows how to list all processes the non toolhelp way. MSDN also has well a commented example for this approach.
Also, I think you forgot to mention to include: tlhelp32.h |
Yeah, my bad, forgot the toolhelp header. I think I pieced this together from MSDN code about a year or so ago, so that's why it uses toolhelp.
|
What's the difference between the toolhelp (snapshot) way and the other way?
|
| All times are GMT -5. The time now is 11:05 AM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC