Windows 7 64 位 shell 无法识别 Shell 扩展安装
我有一个 Copy Hook Handler shell 扩展,我正在尝试将其安装在 Windows 7 64 位上。
shell 扩展 DLL 针对 32 位和 64 位 Windows 编译为两个单独的版本。
DLL 实现了 DLLRegisterServer,它添加了必要的注册表项。
添加注册表项后,它会调用以下代码行来通知 Windows shell:
SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, NULL, NULL);
在 Windows7 32 位上一切正常。 shell 立即识别扩展名。
在 64 位上,只有在重新启动 shell 后才能识别 shell 扩展。
我可以做些什么来使扩展在不重新启动 64 位 shell 的情况下被识别?
I have a Copy Hook Handler shell extension that I'm trying to install on Windows 7 64-bit.
The shell extension DLL is compiled in two separate versions for 32-bit and 64-bit Windows.
The DLL implements DLLRegisterServer which adds the necessary registry entries.
After adding the registry entries, it calls the following line of code to nofity the Windows shell:
SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, NULL, NULL);
Everything works great on Windows7 32-bit. The shell recognizes the extension immediately.
On 64-bit, the shell extension is only recognized after the shell is restarted.
Is there anything I can do to cause the extension to be recognized without restarting the 64-bit shell?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
事实证明,该问题并非 64 位 Windows 特有。
咨询 Microsoft 后,我了解到此行为会影响 32 位和 64 位系统中的复制挂钩处理程序。具有 SHCNE_ASSOCCHANGED API 的 SHChangeNotify() 显然不会导致 shell 重新加载复制挂钩处理程序。
根据 Microsoft 代表的说法:
当第一次在进程中调用复制挂钩处理程序时,shell 会构建并缓存已注册的复制挂钩处理程序的列表。创建列表后,除了终止进程之外,没有任何机制可以更新或刷新缓存。这适用于 Windows 资源管理器和任何其他可能调用 shell 文件函数(例如 SHFileOperation)的进程。此时我们可以提供的最佳选择是在注册复制挂钩处理程序后重新启动系统。
希望这对某人有帮助!
As it turns out, the problem was not specific to 64-bit Windows.
After consulting with Microsoft, I learned that this behavior affects Copy Hook Handlers in both 32 and 64 bit systems. The SHChangeNotify() with SHCNE_ASSOCCHANGED API apparently does not cause the shell to reload Copy Hook Handlers.
According to a Microsoft representative:
The shell builds and caches a list of registered copy hook handlers the first time copy hook handlers are called in a process. Once the list is created, there is no mechanism for updating or flushing the cache other than terminating the process. This applies to Windows Explorer and any other process that may call shell file functions, such as SHFileOperation. The best option that we can offer at this point is to reboot the system after the copy hook handler is registered.
Hope this helps someone!