void PrintProcessList();
int main(){
PrintProcessList();
system(\"pause\");
return 0;
}
void PrintProcessList(){
HANDLE pHandle;
PROCESSENTRY32 proc;
DWORD procId;
pHandle = CreateToolhelp32Snapshot(0x2,0x0);
if(pHandle==INVALID_HANDLE_VALUE){
return;
}
proc.dwSize = sizeof(PROCESSENTRY32);
while(Process32Next(pHandle,&proc)){
printf(\"ProcessName : %s - ProcessID : %d\\r\\n\",proc.szExeFile,proc.th32ProcessID);
}
CloseHandle(pHandle);
return;
}
本文地址:https://www.stayed.cn/item/4258
转载请注明出处。
本站部分内容来源于网络,如侵犯到您的权益,请 联系我