Attach BHO to running instance of IE

Sanjay Verma replied to nishant sagar at 05-Jul-08 01:24
The BHO will attach itself to each instance of IE. Each IE instance may be in a separate process (and a DLL has to be loaded by each process) or several instances of IE may run in the same process. This is very important to understand when dealing with global variables. When several IE instances happen to run in the same process, they load the BHO DLL just once, though each still creates its own instance of a BHO object. Global variables are shared between all BHO instances running in the same process, so you have to use some kind of synchronization when modifying these variables. If you wish to test this, you can launch IE in a separate process each time you launch IE from the desktop, or you can launch another instance of IE in the same process by right-clicking on a link and selecting 'Open in New Window'.

By the way, note the call to AtlMessageBox in EditOptions(). This is an ATL function that displays a normal message box, but has the added benefit of taking string IDs instead of quoted strings. By placing the strings in the resource file it will be easier to internationalize Popup Blocker at a later date (maybe version 3).

See the following article for more details ::

http://www.codeproject.com/KB/shell/popupblocker2.aspx

http://msdn.microsoft.com/en-us/library/bb250436.aspx


Hope it helps.
Biography
Asp.Net Developer

Click here to sign in and reply. You could earn money via our $500 contest just for being helpful.
  How to attach a BHO in currently running IE instance - nishant sagar  05-Jul-08 12:57 12:57:00 AM
      Attach BHO to running instance of IE - Sanjay Verma  05-Jul-08 01:24 1:24:40 AM
      See this for BHO - Sujit Patil  05-Jul-08 01:44 1:44:31 AM
      Try like this - santhosh kumar  05-Jul-08 01:54 1:54:37 AM
          Need to attach BHO to RUNNING IE Instance, not new instances... - nishant sagar  05-Jul-08 05:09 5:09:41 AM
View Posts