Advertisement Jump to content
Sign in to follow this  
jimywang

Get a list of processes running in Win32

This topic is 5045 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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!