Windows 7 does not fire DISPID_BEFORENAVIGATE2 event?

孤街浪徒 提交于 2019-12-08 09:19:39

问题


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:


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.



来源:https://stackoverflow.com/questions/1133786/windows-7-does-not-fire-dispid-beforenavigate2-event

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!