64,651
社区成员
发帖
与我相关
我的任务
分享
#include<tlhelp32.h>
#include"windows.h"
PROCESSENTRY32 pe32;
pe32.dwSize = sizeof(pe32);
HANDLE hp = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS,0);
bool find = Process32First(hp,&pe32);
while (find)
{
if (lstrcmp(pe32.szExeFile,L"QQ.exe")==0)
{
printf("%d",pe32.th32ProcessID);
break;
}
find = Process32Next(hp,&pe32);
}