65,210
社区成员
发帖
与我相关
我的任务
分享
HANDLE hSnapShot;
hSnapShot = CreateToolhelp32Snapshot (TH32CS_SNAPALL,NULL);
PROCESSENTRY32 pEntry;
pEntry.dwSize = sizeof(pEntry);
DWORD dProcessID;
//Buffer for Process Info
char mm[256];
//Get first process
Process32First (hSnapShot, &pEntry);
//Iterate thru all processes
while(1)
{
strcpy (mm, pEntry.szExeFile);//store in CString mm
if (0 == strcmp (mm, 进程名))
{
//用spy++找到窗口按钮的HANDLE,也可以枚举窗口上空间,如果类型为button的(前提只有一个)就sendmessage 点击事件
}
BOOL hRes = Process32Next (hSnapShot,&pEntry);
if (hRes == FALSE)
break;
}