Listing Processes – Part 2: Using PSAPI

A previous article shows how to list running processes from command line. Next, we’ll see how to get a list of processes in our own programs. Let’s start by using Process Status API (PSAPI).


Here is an example that calls EnumProcesses PSAPI function, then fills an array with the found process identifiers.

Once having the process identifiers, we can call OpenProcess to get process handles, then use the handles in other functions which get info about processes. Next example fills a listview control with process identifiers, names and image file paths.

Demo project

The demo project is a simple MFC dialog-based application that uses the above functions.
Download: (1291)

Using PSAPI - Demo Application

Using PSAPI – Demo Application


See also

Leave a Reply