Search code examples
winapi

Is there any Win32 API to get the total number of running processes on Windows 10?


Right now, I use CreateToolhelp32Snapshot() to calculate the number of running processes by traversing a snapshot of all processes. Is there any API to get the number directly, instead of traversing?


Solution

  • EnumProcesses and divide by 4. Internally this calls the NT API and traverses last time I looked but that was a long time ago...