1
votes

I have a BHO that is supposed to intercept the DISPID_BEFORENAVIGATE2 events when Windows Explorer is browsing the local disks. It works well in XP and Vista, but stopped working in Windows 7 RC.

Turns out, Windows 7 RC stopped sending the DISPID_BEFORENAVIGATE2 events when the local folders are browsed! It does send other events to my BHO (such as DISPID_DOWNLOADBEGIN, etc.), but I need DISPID_BEFORENAVIGATE2.

Can anyone confirm this and/or offer a possible workaround?

Thanks!

1
Looking at the Win7 sources, it definitely looks like the DWebBrowserEvents interface isn't called by the shell anymore (which sorta makes sense because IE was fully pulled out of the shell). Unfortunately, I don't know what the replacement is.EricLaw
Eric, thank you for your comment, it's nice to be able to hear from someone who can look into the Win7 sources :-) However, it seems that other events of the DWebBrowserEvents interface do get fired by Win7. I've recompiled the source of the IEHelper sample (found it in MSDN) and it shows other events such as DISPID_DOWNLOADBEGIN, DISPID_PROGRESSCHANGE, etc. All the regular events are present except for DISPID_BEFORENAVIGATE2. It looks like a bug to me.Andrei Belogortseff
OK, Windows 7 RTM finally arrived, the bug is still there: DISPID_NAVIGATECOMPLETE2, etc. get logged, but DISPID_BEFORENAVIGATE2is missing. Microsoft, why are you doing this to me? :-)Andrei Belogortseff

1 Answers

0
votes

Well, it's over a year late, but here's a workaround: Simply set an API hook on IShellBrowser::BrowseObject using an API hook library such as MinHook. See here for sample code that does this: API Hook on a COM object function?

This will route navigations in ALL IShellBrowser instances through your detour. But, IShellBrowser extends IOleWindow, so you can use IOleWindow::GetWindow and SendMessage to work with an individual IShellBrowser instance whose window you've subclassed.