Windows下用C++关闭某个窗口的简单方法
头文件中定义:
BOOL CALLBACK EnumWindowsProc(HWND hwnd, LPARAM lParam);
代码中添加:
#include <windows.h>
{
char wtitle[512];
GetWindowText(hwnd, wtitle, sizeof(wtitle));
if (strstr(wtitle , "Visual Studio"))
{
::SendMessage(hwnd, WM_CLOSE, 0, 0);
}
return (true);
}
调用代码:
EnumWindows(EnumWindowsProc, 0);
:233网校- 计算机二级考试
最后
以上就是想人陪冬天最近收集整理的关于Windows下用C++关闭某个窗口的简单方法的全部内容,更多相关Windows下用C++关闭某个窗口内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复