简体   繁体   English

关闭 Internet Explorer 的所有实例

[英]close all instances of internet explorer

So I was thinking of a way to go about writing a program that closes all instances of internet explorer.所以我在想一种方法来 go 关于编写一个关闭所有 Internet Explorer 实例的程序。 Would it be better to terminate all iexplore.exe processes using the windows API or enumerate the internet explorer windows and close it that way?使用 windows API 终止所有 iexplore.exe 进程或枚举 Internet Explorer windows 并以这种方式关闭它会更好吗? (using enumwindows). (使用枚举窗口)。

I know it's late, but:我知道已经晚了,但是:

https://blogs.msdn.microsoft.com/oldnewthing/20040720-00/?p=38393/ https://blogs.msdn.microsoft.com/oldnewthing/20040720-00/?p=38393/

You will only need the first 2 IFs from method RecalcText().您只需要 RecalcText() 方法中的前 2 个 IF。 Paste there this code:粘贴此代码:

HWND hwndWBA;
pwba->get_HWND((LONG_PTR*)&hwndWBA);
InvalidateRect(hwndWBA, NULL, TRUE);
pwba->Quit();
pwba->Release();

It will close all explorers.它将关闭所有浏览器。 Not only Internet Explorers, but also folder explorers.不仅是 Internet Explorer,还有文件夹浏览器。 Works on desktop (tested on Windows 7).在桌面上工作(在 Windows 7 上测试)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM