You are currently offline, waiting for your internet to reconnect

SAMPLE: IEHelper-Attaching to Internet Explorer 4.0 by Using a Browser Helper Object

This article was previously published under Q179230
In order to attach to a running instance of Internet Explorer 4.0, you canuse a "Browser Helper Object." A "Browser Helper Object" is a DLL that willattach itself to every new instance of Internet Explorer 4.0. You can usethis feature to gain access to the object model of a particular runninginstance of Internet Explorer. You can also use this feature to get eventsfrom an instance of Internet Explorer 4.0.

This article also points to a sample that demonstrates how to implement aBrowser Helper Object.
The following file is available for download from the Microsoft Download Center:
For additional information about how to download Microsoft Support files, click the following article number to view the article in the Microsoft Knowledge Base:
119591 How to Obtain Microsoft Support Files from Online Services
Microsoft scanned this file for viruses. Microsoft used the most current virus-detection software that was available on the date that the file was posted. The file is stored on security-enhanced servers that help to prevent any unauthorized changes to the file.

Browser Helper Objects

When an instance of Internet Explorer 4.0 is started, it looks in theregistry for CLSIDs stored under the following key:
HKLM\SOFTWARE\Microsoft\Windows \CurrentVersion\Explorer\Browser Helper Objects
If this key exists and there are CLSIDs listed under it, Internet Explorerwill use CoCreateInstance() to try to create an instance of each objectlisted as a subkey under this key. Note that the CLSID of the object youcreate must be listed as a subkey and not a named value.

For example, imagine that the following entry exists in the registry,HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Browser HelperObjects\{CE7C3CF0-4B15-11D1-ABED-709549C10000}. Internet Explorer will tryto create an instance of the object pointed to by the CLSID {CE7C3CF0-4B15-11D1-ABED-709549C10000} each time Internet Explorer starts.

These registry keys can be created manually or through the selfregistration portion of your COM application.

There are some requirements when creating a Browser Helper Object

  • The application that you create must be an in-proc server (that is, DLL).
  • This DLL must implement IObjectWithSite.
  • The IObjectWithSite::SetSite() method must be implemented. It is through this method that your application receives a pointer to Internet Explorer's IUnknown. (Internet Explorer actually passes a pointer to IWebBrowser2 but the implementation of SetSite() receives a pointer to IUnknown.) You can use this IUnknown pointer to automate Internet Explorer or to sink events from Internet Explorer.
  • It must be registered as a Browser Helper Object as described above.
WARNING: Internet Explorer will create an instance of each Browser HelperObject listed in the registry every time a new instance of InternetExplorer is started. This means that if you have Active Desktop installed,the Browser Helper Objects will be loaded every time you open a new folderas well as when the browser itself is started.
IEHelper Helper

Article ID: 179230 - Last Review: 08/05/2004 20:05:00 - Revision: 3.2

Microsoft Internet Explorer 4.0 128-Bit Edition, Microsoft Internet Explorer 4.01 Service Pack 2, Microsoft Internet Explorer 5.0, Microsoft Internet Explorer 5.01, Microsoft Internet Explorer 5.5, Microsoft Internet Client Software Development Kit 4.0, Microsoft Internet Client Software Development Kit 4.01

  • kbinfo kbdownload kbfile kbsample kbfaq KB179230