Wednesday, October 17, 2012

Browser Helper Object (BHO) is the most useful plug-in for IE (Internet Explorer). BHO is a program which extends the functionality of a browser. It is very much useful in retrieving information or modifying the content of the web page that is being displayed in a browser window. Moreover, this plug-in also helps users with the variable options as per their requirements for example Weather details or Stock market status.

BHO is the best tool to utilize add-ons and tools with web browsers. This IE plug-in with numerous functionalities broadens the  usage of Internet Explorer.


Here I have explained the simple implementation of BHO.

BHO is a Component Object Model (COM) object loaded for each IE window. When the browser window is opened, it creates its own copy of the BHO and when you close the window, it destroys its copy of the BHO. You will need a COM DLL that perfectly interacts with browser. This is perfectly carried out by implementing the IobjectWithSite in class. Next, you need to use COM itnerop library to implement COM DLL in .Net project.

When you are writing in C#, we also need to write the interface IobjectWithSite ourselves. Further, you need to implement the interface in your BHO.

In order to interact with the HTML document, you will have to add a reference to the Microsoft mshtml library and to get the DOM or the webpage currently in the browser.

Next, you will have to add Shdoc Vw library as a reference. Also, you will have to add 2 more functions which will register (or unregister) COM component as a BHO with Internet Explorer with the key.

In this way, you can add BHO. This is just the beginning, you need to still go a long way for professional BHO development. Hope this will help you start with your browser Plug-in development. Please share your experience in the comment box.

0 comments:

Post a Comment