Jump to content
  • Advertisement
Sign in to follow this  
jimywang

Get a list of processes running in Win32

This topic is 4856 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Advertisement
Try to google on "win32 process enumeration" for example...

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
create a snapshot with: CreateToolhelp32Snapshot()

and then use Process32First and Process32Next to enumerate the processes

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
some of my old code

HANDLE snapshot = (TH32CS_SNAPPROCESS , 0);
if(snapshot == INVALID_HANDLE_VALUE) return false;

// enumerate the snapshot
PROCESSENTRY32 processEntry;
if(Process32First(snapshot, &processEntry) == FALSE)
{
return false;
}
processesRunning.push_back(processEntry);
while(Process32Next(snapshot, &processEntry) != FALSE)
{
processesRunning.push_back(processEntry);
}

// close the snapshot
CloseHandle(snapshot);

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!