none
DISPID_BEFORENAVIGATE2 event is not fired in Windows 8 Release Preview / Internet Explorer 10

    Dotaz

  • Per http://msdn.microsoft.com/en-us/library/aa770041(v=vs.85).aspx, you can control navigation by implementing your IDispatch::Invoke method to handle DISPID_BEFORENAVIGATE2.

    We have been using this technique in our software since 2002 to present commands as hyperlinks. When the DISPID_BEFORENAVIGATE2 event fires our application queries the URL looking for a custom protocol (i.e. custom://...). When a custom protocol is detected, navigation is cancelled and our application posts a WM_COMMAND message to the appropriate window.

    Testing our application on the classic desktop in the Windows 8 Release Preview with IE10 this event is simply not firing. DISPID_DOWNLOADBEGIN is firing without our application having an opportunity to catch and cancel navigation.

    I couldn't locate any documentation stating the DISPID_BEFORENAVIGATE2 event had been deprecated. Is this a bug in Windows 8/IE10 (and if so, how do I go about reporting it) or is there a better technique to use to catch and prevent navigation?

    26. června 2012 17:49

Všechny reakce

  • Does not look like reported on https://connect.microsoft.com/IE/Feedback, you can submit a bug there.


    The following is signature, not part of post
    Please mark the post answered your question as the answer, and mark other helpful posts as helpful, so they will appear differently to other users who are visiting your thread for the same problem.
    Visual C++ MVP

    26. června 2012 23:15
  • Per http://msdn.microsoft.com/en-us/library/aa770041(v=vs.85).aspx, you can control navigation by implementing your IDispatch::Invoke method to handle DISPID_BEFORENAVIGATE2.

    We have been using this technique in our software since 2002 to present commands as hyperlinks. When the DISPID_BEFORENAVIGATE2 event fires our application queries the URL looking for a custom protocol (i.e. custom://...). When a custom protocol is detected, navigation is cancelled and our application posts a WM_COMMAND message to the appropriate window.

    Testing our application on the classic desktop in the Windows 8 Release Preview with IE10 this event is simply not firing. DISPID_DOWNLOADBEGIN is firing without our application having an opportunity to catch and cancel navigation.

    I couldn't locate any documentation stating the DISPID_BEFORENAVIGATE2 event had been deprecated. Is this a bug in Windows 8/IE10 (and if so, how do I go about reporting it) or is there a better technique to use to catch and prevent navigation?

    Hi Jeffrey,

    I've a BHO component adopted for use under IE10/Win8. I can say that all events (including OnBeforeNavigate2) are fired as expected in IE 10 with and without EPM. Seems like there are no changes in architecture for BHO at least. However, I don't know if this relevant for the controls as well (but I think it should be the same). I can only suggest you to debug your control and try to figure out what is going wrong.


    Best regards, Sergey

    27. června 2012 9:42
  • We are having a similar problem. Our existing code works in XP, Vista, Win 7 and Windows 8 Developer Preview but has started failing as of the Release Preview (no data avail. for the Consumer Preview).

    In our case, a form post to a url using the "about:" protocol would fire the expected events and allow access to the form's postdata, which we would process and then cancel the navigation. Simple hyperlinks whose hrefs use the "about:" protocol still seem to raise the BeforeNavigate2 event as before.

    If I'm understanding the instructions at the link given by Sheng Jiang above, we are expected to download and run the Feedback Tool to indicate such observations.

    We will do this and look for guidance.

    27. června 2012 22:16