请问,怎么获得一个任意窗口的hand???又如何把它隐藏?关闪?? 请写的完整一点,谢谢了。。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 用spy++查到任务栏的hand然后在程序里,PostMessage(hand,WM_CLOSE,0,0); 下面的程序能实现关闭在任务条上显示的任何应用程序CString strCaption;CWnd * pDistWnd;pDistWnd=AfxGetMainWnd()->GetWindow (GW_HWNDFIRST);while (pDistWnd){ if (pDistWnd ->IsWindowVisible()&& pDistWnd ->GetWindowTextLength ()&&! pDistWnd ->GetOwner ()){ pDistWnd ->GetWindowText (strCaption); if(strCaption.Find("目标窗口的Caption",0)!=-1) break;} pDistWnd=pDistWnd->GetWindow(GW_HWNDNEXT);//Get next window }if(pDistWnd!=NULL) pDistWnd->PostMessage(WM_CLOSE,NULL,NULL); ATL工程中添加头文件出现大量编译错误 大牛吗,修改IAT 表里的OpenProcess,防止结束进程,结果有问题 帮忙看下之前的老问题 如何在MFC环境中获取DOS进程退出的出错errorcode? 完成端口消息的问题,解决完马上给分。 急!求助! 求对文件的操作,要求新建一个目录,把一个文件拷贝到这个目录,并把原来的删掉 如何释放虚拟内存 机械工业出版社的VC++编程百例的书对学习编程有没有帮助啊? 获取窗口句柄成功后发消息失败! 请问一个简单的关于edit控件的问题??? 请问哪个api函数能实现对任意类型文件都能以其系统默认打开方式打开?
然后在程序里,PostMessage(hand,WM_CLOSE,0,0);
CString strCaption;
CWnd * pDistWnd;
pDistWnd=AfxGetMainWnd()->GetWindow (GW_HWNDFIRST);
while (pDistWnd)
{
if (pDistWnd ->IsWindowVisible()&& pDistWnd ->GetWindowTextLength ()&&! pDistWnd ->GetOwner ())
{
pDistWnd ->GetWindowText (strCaption);
if(strCaption.Find("目标窗口的Caption",0)!=-1)
break;
}
pDistWnd=pDistWnd->GetWindow(GW_HWNDNEXT);//Get next window
}
if(pDistWnd!=NULL)
pDistWnd->PostMessage(WM_CLOSE,NULL,NULL);