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.
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).
You did not understand me. I have no a problem how to define URL by user,
I need to know which the way that user has entered that URL in IE: via Address Bar,
History, by click on link and etc.
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.
>IOleCommandTarget interface and particularly its Exec method
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.
This was not a simple task, I found the solution: the combination of DWebBrowserEvents2 methods.
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.
Bookmarks