Partilhar via


Browser Helper Objects for Windows Explorer

Thanks to TuxExplorer for reminding me to blog about this.

Both Windows Explorer and Internet Explorer are able to load extensions known as Browser Helper Objects (BHOs). BHOs are a minimal extensibility point into both the shell and the browser, allowing extensions to sync to events and react accordingly. For instance, the Mouse Gestures add-on is a BHO designed for IE, while Groove implements a BHO designed to add functionality to the Windows Explorer shell.

Back in the IE6 timeframe, when Windows Explorer could actually host the Web Browser control and render web pages, developers might often want their BHO to load in both Windows Explorer and Internet Explorer. In cases where Developers didn’t want their BHO to load in Windows Explorer, they could simply write a registry key named NoExplorer to prevent their BHO from being loaded into Windows Explorer. A developer who wanted to write a BHO that loaded only in Windows Explorer and not in IE had to do more work—in their DLLMain function, they’d have to get the module handle of the running executable and bail out of doing more work if they found they were running inside iexplore.exe (sample code). That wasn’t great for performance, since the DLL itself must begin loading in order to determine where it is being hosted.

Internet Explorer 9 solves this problem with a new registry key, named NoInternetExplorer. A BHO that has this flag set in the registry (in the same manner as NoExplorer, above) will not be loaded into Internet Explorer. In that way, BHOs designed only for use inside Windows Explorer can be marked not to load in  IE, ensuring that the IE performance isn’t impacted by loading code not meant for the browser.

-Eric

Comments

  • Anonymous
    April 11, 2011
    Is this key only for BHOs or also for toolbars and Explorer bars?

  • Anonymous
    May 07, 2011
    I second that question - how to make this work for toolbars? It is even more important than BHOs. Here's why: For BHOs, it is simply a matter of performance. IE can skip loading some DLL, and that's it. For toolbars though, the name of the toolbar will show in the IE's list of toolbars, even though it is only intended for Windows Explorer. The users will try to select it, and nothing will happen.

  • Anonymous
    February 10, 2012
    Doing checks who loaded dll in DLLMain is bad idea, better do it in DllGetClassObject() or OnFinalConstruct(). I also found today that "Enable third-party browser extensions" in Internet options can be a problem, preventing BHO made for Windows Explorer from loading. This is remnant from the old IE6 days and should be separated from IE.