If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register or Login
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Internet Explorer Events

Hi all,

I write the BHO for IE where I need to catch the IE events from Address Bar, History, Bookmarks. For example, if the user has typed URL in Address Bar,
then BHO has to show me that URL was entered from Address Bar.

Re: Internet Explorer Events

For example, if the user has typed URL in Address Bar,
then BHO has to show me that URL was entered from Address Bar.

DWebBrowserEvents2::BeforeNavigate2 event is fired, when browser is going to be navigated to some URL. The second parameter of BeforeNavigate2 is a URL. Also you can cancel the navigation from BeforeNavigate2 (if you want to).

Re: Internet Explorer Events

OK.
I'm not sure about any documented way to do that.
For undocumented way you may try to hook IOleCommandTarget interface and particularly its Exec method. Exec method is invoked when user interacts with IE frame.

Re: Internet Explorer Events

My addon has to work as a BHO, not as an extension. Exec method is called after press of a button/command in Toolbar/Tools menu. I need to catch the events always.

I'm not speaking about the extension. I meant to hook Web Browser's native IOleCommandTarget interface, which exists during lifetime of IE process. And Exec method is called in much more cases, than described in OLECMDID enumeration. Many of Exec calls undocumented and have other command IDs.

I found the solution: the combination of DWebBrowserEvents2 methods

Glad to hear that you found the solution. No doubt, that is the better way to resolve the issue if it can cover all cases you described.