O'Reilly logo

Extended STL, Volume 1: Collections and Iterators by Matthew Wilson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 22. Enumerating Processes and Modules

 

Never let your sense of morals get in the way of doing what’s right.

 
 --Isaac Asimov
 

This is my shiny thing. And if you try and take it off me I may have to eat you.

 
 --Cat, Red Dwarf

The Windows Process Status API (PSAPI) provides several methods for accessing system state information. For processes, the simplest and most common method is via the EnumProcesses() function, defined as follows:

BOOL EnumProcesses( DWORD*  pProcessIds
                  , DWORD   cb
                  , DWORD*  pBytesReturned);

pProcessIds points to an array into which the process identifiers of process objects in the system are returned. cb is the size of this array, measured in bytes. pBytesReturned points to a single variable that receives the number of bytes ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required