This is a mirror of official site: http://jasper-net.blogspot.com/

BHO Development using managed code

| Tuesday, March 20, 2012
Inline image 2

Introduction

Browser Helper Object (BHO) is a plug-in for Internet Explorer (IE). BHO let developers to drive IE. A plug-in is a program which extends the functionality of a browser. It can be used to retrieve information or modify the content of the webpage that is being displayed in a browser window, or it may just be used to provide the user an option to see the day's Stock market status or, weather in a toolbar.

Background 

To start BHO development can be depressing at the very first beginning to learn all those things. As a beginner I want to share my experience to other beginners. Here I am going to explain the simple implementation of BHO.

A Browser Helper Object is a COM object loaded for each IE window. As a browser window is opened, it creates its own copy of the BHO; and, when the window is closed, it destroys its copy of the BHO. You will need a COM DLL which interact with browser. This need to done by implementing the IObjectWithSite in class. We need to use COM interop library to implement COM DLL in our .NET project.

While we are writing in C#, we also need to write the interface IObjectWithSite ourselves. Also, we have to then implement the interface in your BHO. To interact with the HTML document, we will need to add a reference to the Microsoft.mshtml library and to get the DOM or the webpage currently in the browser, we will have to add SHDocVw library as a reference. Also, we will have to add 2 functions which will register (and unregister) our COM component as a BHO with Internet Explorer with the key.

Read mroe: Codeproject
QR: Inline image 1

Posted via email from Jasper-net

0 comments: