Windows 7 不会触发 DISPID_BEFORENAVIGATE2 事件?
我有一个 BHO,它应该在 Windows 资源管理器浏览本地磁盘时拦截 DISPID_BEFORENAVIGATE2 事件。 它在 XP 和 Vista 中运行良好,但在 Windows 7 RC 中停止运行。
事实证明,当浏览本地文件夹时,Windows 7 RC 停止发送 DISPID_BEFORENAVIGATE2 事件! 它确实向我的 BHO 发送其他事件(例如 DISPID_DOWNLOADBEGIN 等),但我需要 DISPID_BEFORENAVIGATE2。
任何人都可以确认这一点和/或提供可能的解决方法吗?
谢谢!
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!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好吧,已经晚了一年多了,但这里有一个解决方法:只需使用 API 挂钩库(例如 MinHook。 请参阅此处执行此操作的示例代码:COM 对象函数上的 API 挂钩?
这将在所有
IShellBrowser 中路由导航
实例走过你的弯路。 但是,IShellBrowser
扩展了IOleWindow
,因此您可以使用IOleWindow::GetWindow
和SendMessage
来处理单个< code>IShellBrowser 实例,您已对其窗口进行子类化。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
extendsIOleWindow
, so you can useIOleWindow::GetWindow
andSendMessage
to work with an individualIShellBrowser
instance whose window you've subclassed.