IEHelper-Attaching to Internet Explorer 4.0 using a Browser Helper Object

ID: Q179230


The information in this article applies to:
  • Microsoft Internet Explorer (Programming) versions 4.0, 4.01
  • Internet Client SDK, versions 4.0, 4.01


SUMMARY

In order to attach to a running instance of Internet Explorer 4.0, you can use a "Browser Helper Object." A "Browser Helper Object" is a DLL that will attach itself to every new instance of Internet Explorer 4.0. You can use this feature to gain access to the object model of a particular running instance of Internet Explorer. You can also use this feature to get events from an instance of Internet Explorer 4.0.

This article also points to a sample that demonstrates how to implement a Browser Helper Object.


MORE INFORMATION

The following files are available for download from the Microsoft Download Center. Click the file names below to download the files:

IEHelper.exe
For more information about how to download files from the Microsoft Download Center, please visit the Download Center at the following Web address
http://www.microsoft.com/downloads/search.asp
and then click How to use the Microsoft Download Center.

Browser Helper Objects

When an instance of Internet Explorer 4.0 is started, it looks in the registry 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 Explorer will use CoCreateInstance() to try to create an instance of each object listed as a subkey under this key. Note that the CLSID of the object you create 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 Helper Objects\{CE7C3CF0-4B15-11D1-ABED-709549C10000}. Internet Explorer will try to 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 self registration 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 Helper Object listed in the registry every time a new instance of Internet Explorer is started. This means that if you have Active Desktop installed, the Browser Helper Objects will be loaded every time you open a new folder as well as when the browser itself is started.

© Microsoft Corporation 1998, All Rights Reserved.
Contributions by Scott Roberts, Microsoft Corporation

Additional query words: Helper

Keywords : kbfile kbIE400 kbIE401 kbDSupport kbIEFAQ
Version : WINDOWS:4.0,4.01
Platform : WINDOWS
Issue type : kbinfo


Last Reviewed: February 1, 2000
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.