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?
EnumProcesses
and divide by 4. Internally this calls the NT API and traverses last time I looked but that was a long time ago...