比较进程名总失败,散分求助!
while(bRet)
{
//pe.szExeFile保存的值为进程对应的可执行文件名
if(strcmp(pe.szExeFile,"QQ.exe") ==0)
{
BOOL bRet;
//枚举所有窗口,把进程PID传给回调函数EnumAllWindowsProc
bRet = EnumWindows(EnumAllWindowsProc,(LPARAM)pe.th32ProcessID);
if(bRet == FALSE)
{
MessageBox(NULL,TEXT("枚举所有顶层窗口失败!"), TEXT("失败"),0);
return -1;
}
//枚举登陆窗口的所有子窗口,执行上面的函数后就会得到登陆窗口的句柄了
bRet = EnumChildWindows(hLoginWindow,EnumChildWindowsProc,NULL);
if(bRet == FALSE)
{
MessageBox(NULL,TEXT("枚举子窗口失败!"), TEXT("失败"),0);
return -1;
}
MessageBox(NULL,TEXT("枚举窗口成功!"), TEXT("成功"),0); //
}
bRet = Process32Next(hProcessSnap,&pe);
}
我认为问题是出在:if(strcmp(pe.szExeFile,"QQ.exe") ==0)这一句,strcmp好像只能用在DOS窗口下,而我的程序是窗体的.
相关推荐
基于java+spring+springMVCl的医疗系统开题报告.docx
基于java+spring+springMVCl的医疗系统开题报告.docx
linux ubuntu apt-get报错E: Unable to correct problems, you have held broken packages.
报错内容: $ sudo apt-get install lm-sensors sensors-applet Reading package lists... Done Building dependency tree Reading state information... Done lm-sensors is already the newest version (1:3.3.4-2ubuntu1). Some packages could not be installed. This may mean
基于java+spring+springMVCl的学生就业管理系统开题报告.docx
基于java+spring+springMVCl的学生就业管理系统开题报告.docx
E: Unable to correct problems, you have held broken packages.
在Ubuntu 上安装G++不成功遇到如下错误: ubuntu:~/IC/3.3$ sudo apt install g++ Reading package lists... Done Building dependency tree Reading state information... Done Some packages could not be installed. This may mean that you have requested an impossible situati
安装openssh-server报E: Unable to correct problems, you have held broken packages
一、通过ssh连接,ubuntu系统需要有openssh-server,可以通过 ps -e|grep ssh 来查看, 显示如下: 7153 ? 00:00:00 sshd 7222 ? 00:00:00 sshd 7262 ? 00:00:00 sshd 如果没有显示sshd则说明没有安装openssh-server。 二、安装ssh sudo apt-get install openssh-...


