主要代码分析如下:
//根据进程ID得到进程名称
BOOL processIdToName(LPTSTR lpszProcessName, DWORD PID)
{
HANDLE hSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
PROCESSENTRY32 pe;
pe.dwSize = sizeof(PROCESSENTRY32);
if (!Process32First(hSnapshot, &pe)) {
return FALSE;
}
while (Process32Next(hSnapshot, &pe)) {
if (pe.th32ProcessID == PID) {
strcpy(lpszProcessName, pe.szExeFile);
return true;
}
}
return FALSE;
}
//查找QQ登录窗口
void QQFind()
{
HWND hWnd1 = NULL, qqID_hWnd = NULL, qqPass_hWnd = NULL;
HWND ButtonLogin = NULL, ButtonCancel = NULL;
char sTitle[255];
CString ss;
DWORD QQPID;
int LoginID;
BOOL find = FALSE;
本内容试读结束,登录后可阅读更多
下载后可阅读完整内容,剩余3页未读,立即下载