• Advertisement
Sign in to follow this  

Get a list of processes running in Win32

This topic is 4683 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