#include #pragma comment(lib,"Psapi.lib") DWORD dwProcesses[1024], dwRes; EnumProcesses(dwProcesses,sizeof(dwProcesses),&dwRes); for (int i = 0; i < dwRes / sizeof(DWORD); i++) { printf("%d %d\r\n",i,dwProcesses[i]); }