快照方式枚举 ProcessID
来源:互联网 发布:淘宝秒杀需要刷新吗 编辑:程序博客网 时间:2024/06/04 18:17
//获取ProcessID#include "stdafx.h"#include #include #include #include using namespace std; int main() { HANDLE hsnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS,0); PROCESSENTRY32 *processinfo = new PROCESSENTRY32; processinfo->dwSize = sizeof(PROCESSENTRY32); int index=0; while( Process32Next ( hsnapshot, processinfo ) != FALSE ) { index++; printf("****%d****",index); cout <<"********************************" <<ENDL; } <pre 0; return CloseHandle(hsnapshot); <<endl; *********************************? th32ParentProcessID=" <th32ParentProcessID <<endl; cout <<" DWORD th32ProcessID=" <th32ProcessID <<endl; cout <<" <<?DWORD cout>