Listing Processes – Part 5: Using Windows Management Instrumentation (WMI)

Using Win32_Process WMI class A previous article shows how to use Win32_PhysicalMedia WMI class to get physical drive info. We can write something similar for getting a list of running processes. All we have to do is to replace the WQL query and get specific properties for Win32_Process. However, to simplify the things, I wrote … Read more

Listing Processes – Part 4: Using Remote Desktop Services API

Using Remote Desktop Services API We can call WTSEnumerateProcesses function to get information about the active processes on a specified Remote Desktop Session Host server. However, if pass WTS_CURRENT_SERVER_HANDLE in first argument (server handle), we can enumerate and get info about processes which are running on local machine. The following example calls WTSEnumerateProcesses function, then … Read more

Listing Processes – Part 3: Using Tool Help Library

Tool Help Library makes it easy to enumerate and get info about processes, threads, modules, and heaps. Let’s use it to get a list of running processes. Using Tool Help Library First, take a snapshot by passing TH32CS_SNAPPROCESS flag to CreateToolhelp32Snapshot function. Next, pass the snapshot handle to Process32First, then to Process32Next to get running processes … Read more

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). Using PSAPI Here is an example that calls EnumProcesses PSAPI function, then fills an array with the found process identifiers. #include <Psapi.h> … Read more

Listing Processes – Part 1: Introduction

Many users know about Task Manager that allows, between others, to quickly list the currently running processes and get info about each one. Some advanced users may also deal with Windows Resource Monitor, for real-time monitoring the running processes. Other ones may use command line tools lile Tasklist or Tlist as well as complex third-party … Read more