CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7
  1. #1
    Join Date
    Aug 2001
    Posts
    88

    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?

  2. #2
    Join Date
    May 2000
    Location
    Armenia
    Posts
    201

    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).

  3. #3
    Join Date
    Aug 2001
    Posts
    88

    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.

  4. #4
    Join Date
    May 2000
    Location
    Armenia
    Posts
    201

    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.

  5. #5
    Join Date
    Aug 2001
    Posts
    88

    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.

  6. #6
    Join Date
    May 2000
    Location
    Armenia
    Posts
    201

    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.

  7. #7
    Join Date
    Aug 2001
    Posts
    88

    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
  •  





Click Here to Expand Forum to Full Width

Featured