Windows 7 does not fire DISPID_BEFORENAVIGATE2 event?

2.1k views Asked by At

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

There are 1 answers

0
Paul Accisano On

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.