如何通过窗口标题找到进程,并在打开时关闭它
How to find process by windows title and close it whenever open
我想在进程打开时通过窗口标题关闭进程。我是怎么做的?
在Windows上,使用FindWindow()
定位具有所需标题的窗口,如果找到,则使用PostMessage()
向其发布WM_QUIT
消息。如果窗口在一段时间后仍在运行,那么您可能能够通过使用GetWindowThreadProcessId()
, OpenProcess()
和TerminateProcess()
来暴力杀死它,具体取决于权限。
相关文章:
- 无法在 GLFW 窗口标题中显示'ä'
- 为什么抓取窗口标题的代码会导致应用崩溃?
- 如何正确获取 Unicode 窗口标题
- 如何随机化程序的窗口标题?
- 如何在QT中获取背景应用程序窗口标题
- 如何在 Ubuntu Qt 中获取活动窗口标题
- 最佳地将窗口标题替换为新的 QString
- 构造函数字符串参数未设置窗口标题
- 获取C++中的窗口标题
- C++:为什么此窗口标题被截断
- 窗口标题GLFW中的FPS计数器
- 如何永久删除主窗口标题栏
- 使用WM_GETTEXT获取窗口标题
- 在窗口标题和消息框中显示错误的语言:win32应用程序,opengl
- 在GLFW窗口标题中显示FPS
- 如何从其进程路径中获取窗口标题
- 无法获取窗口标题
- 在Qt中更改主窗口标题
- 如何在 Windows 上获取C++ 个字符 * 格式的当前窗口标题?
- 如何通过窗口标题找到进程,并在打开时关闭它