Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
每当该进程打开时,我都想按 Windows 标题关闭进程。我怎么做?
在 Windows 上,使用FindWindow()查找具有所需标题的窗口,如果找到,则使用PostMessage()向其发布WM_QUIT消息。如果窗口在一段时间后仍在运行,那么您可以根据权限,通过使用 和 来蛮力GetWindowThreadProcessId()杀死OpenProcess()它TerminateProcess()。
FindWindow()
PostMessage()
WM_QUIT
GetWindowThreadProcessId()
OpenProcess()
TerminateProcess()