Taking a Snapshot and Viewing Processes
The following example obtains a list of running processes. First, the GetProcessList
function takes a snapshot of the currently executing processes in the system using the CreateToolhelp32Snapshot function, then it walks through the list recorded in the snapshot, using the Process32First and Process32Next functions. For each process, the function calls GetProcessModule
, which is defined in Traversing the module list.