-
July 22nd, 2011, 07:20 AM
#1
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.
Is it possible?
Any ideas?
-
July 22nd, 2011, 08:40 PM
#2
Re: Internet Explorer Events
You may take a look at DWebBrowserEvents2 interface.
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).
-
July 22nd, 2011, 10:47 PM
#3
Re: Internet Explorer Events
>DWebBrowserEvents2::BeforeNavigate2
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.
-
July 24th, 2011, 08:07 AM
#4
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.
-
July 25th, 2011, 11:03 PM
#5
Re: Internet Explorer Events
>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.
-
July 26th, 2011, 05:14 AM
#6
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.
-
August 4th, 2011, 12:11 AM
#7
Re: Internet Explorer Events
Ah...., understood your idea,
But I don't know any way how to make a global hook on Exec. Please, example.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|