BHO Browser Helper Object

Source: Internet
Author: User
BHO principle:

BHO is the Browser Helper Object)

BHO Association Principle(BHO is associated with SHDOCVW, that is to say, it is not only associated with IE. We will describe it with IE below)

1. when the IE window is opened, find the CLSID in SOFTWARE \ Microsoft \ Windows \ CurrentVersion \ Explorer \ Browser Helper Objects \ under HKLM. These CLSID correspond to the corresponding BHO plug-in, then, locate the plug-in information, including the file location, in the CLSIDs under HKCR Based on the CLSID.
2. IE creates a BHO object based on the CLSID information and finds the IObjectWithSite interface. (This interface is very simple. Only the SetSite and GetSite methods are available.) 3. IE uploads IWebBrowser2 (browser plug-in) to the SetSite method of BHO. You can mount your own event processing method in this method. 4. When the window is closed, IE transfers null to the SetSite method of BHO. This method is used to remove the mounting event processing method.

Compiling BHO Process
1. Create an IObjectWithSite explicit interface, create a COM type, and inherit the IObjectWithSite Interface
2. implement this interface and add the event to be mounted in the SetSite Method
3. Handling events
4. Register this BHO to Software \ Microsoft \ Windows \ CurrentVersion \ Explorer \ Browser Helper Objects under HKLM in the registry; (CLSIDs under HKCR is automatically registered based on the above path)
5. Under. net, you must set the Configuration Attribute of this BHO project to "True" for Interop in generation to register the. net class library file to COM.

The source code is as follows:
Http://files.cnblogs.com/joybing/UrlFilter.zip

(Note: IE is only a program based on the WebBroswer plug-in. For programming, WebBroswer can be used directly. Specifically, Microsoft Internet Controls (SHDocVw) is referenced ))

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.