自定义预览窗格 - 适用于 Windows7,不适用于 Vista
我编写了一个资源管理器扩展来在预览窗格中显示我的自定义文件格式。这在 Windows 7 中工作正常,但在 Vista 中似乎不起作用。同一个 DLL 可以处理缩略图和预览窗格。缩略图方面在 Vista 和 Windows7 中都可以使用。
将日志添加到我的代码中,Vista 只为缩略图类调用我的 DllGetClassObject 函数,而不是预览处理程序类。
在调用 COM DLL 时,Vista 与 Windows7 的做法有什么明显的不同吗?
以下是我要添加到注册表中的值:
HKEY_CLASSES_ROOT\\.<myext>\\(default) = "<myext>.Thumbnail.Handler.1"
HKEY_CLASSES_ROOT\\<myext>.Thumbnail.Handler.1\\ShellEx\\{8895b1c6-b41f-4c1c-a562-0d564250836f}\\(default) = "<myguid>"
HKEY_CLASSES_ROOT\\CLSID\\<myguid>\\(default) = "<myext> Preview Handler"
HKEY_CLASSES_ROOT\\CLSID\\<myguid>\\DisplayName = "@ExplorerPreviewHandler.dll,-101"
HKEY_CLASSES_ROOT\\CLSID\\<myguid>\\Icon = "@ExplorerPreviewHandler.dll,201"
HKEY_CLASSES_ROOT\\CLSID\\<myguid>\\AppID = "{6d2b5079-2f0b-48dd-ab7f-97cec514d30b}"
HKEY_CLASSES_ROOT\\CLSID\\<myguid>\\InProcServer32\\(default) = "<path to my dll>"
HKEY_CLASSES_ROOT\\CLSID\\<myguid>\\InProcServer32\\ThreadingModel = "Apartment"
HKEY_CLASSES_ROOT\\CLSID\\<myguid>\\InProcServer32\\ProgID = "<myext>.Thumbnail.Handler.1"
HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\PreviewHandlers\\<myguid> = "<myext> Preview Handler"},
鉴于我的 DllGetClassObject 没有被调用,我认为问题一定与我在注册表中的设置有关?我知道 DLL 导出没问题,因为它适用于 Vista 和 Win7 中的缩略图,并且适用于 Windows7 中的预览窗格。
DLL 是 x64,我的 Vista 和 Win7 操作系统也是。 DLL是用C++编写的,没有ATL。
感谢您对此提供的任何帮助, 担。
I've written an explorer extension to display my custom file format in the Preview Pane. This works fine in Windows 7, but doesn't seem to work in Vista. The same DLL handles both thumbnails and the preview pane. The thumbnails side of things work in both Vista and Windows7.
Adding logs to my code, Vistas only calling my DllGetClassObject function for the thumbnail class, not the preview handler class.
Is there anything obvious that Vista does differently to Windows7 when calling COM DLLs?
Here's the values I'm adding to the registry:
HKEY_CLASSES_ROOT\\.<myext>\\(default) = "<myext>.Thumbnail.Handler.1"
HKEY_CLASSES_ROOT\\<myext>.Thumbnail.Handler.1\\ShellEx\\{8895b1c6-b41f-4c1c-a562-0d564250836f}\\(default) = "<myguid>"
HKEY_CLASSES_ROOT\\CLSID\\<myguid>\\(default) = "<myext> Preview Handler"
HKEY_CLASSES_ROOT\\CLSID\\<myguid>\\DisplayName = "@ExplorerPreviewHandler.dll,-101"
HKEY_CLASSES_ROOT\\CLSID\\<myguid>\\Icon = "@ExplorerPreviewHandler.dll,201"
HKEY_CLASSES_ROOT\\CLSID\\<myguid>\\AppID = "{6d2b5079-2f0b-48dd-ab7f-97cec514d30b}"
HKEY_CLASSES_ROOT\\CLSID\\<myguid>\\InProcServer32\\(default) = "<path to my dll>"
HKEY_CLASSES_ROOT\\CLSID\\<myguid>\\InProcServer32\\ThreadingModel = "Apartment"
HKEY_CLASSES_ROOT\\CLSID\\<myguid>\\InProcServer32\\ProgID = "<myext>.Thumbnail.Handler.1"
HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\PreviewHandlers\\<myguid> = "<myext> Preview Handler"},
Given that my DllGetClassObject isn't being called, I presume the problem must be something to do with what I'm setting in the registry? I know the DLL exports are okay, as it works for the thumbnails in both Vista and Win7, and works for the preview pane in Windows7.
DLL is x64, as are both my Vista and Win7 OSs. DLL is written in C++ without ATL.
Thankyou for any help with this,
Dan.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
reg 看起来还不错,只是缺少默认的 progid。 Win7 确实记录了 PreviewHandlers 键位置的替代行为。不幸的是,SDK 文档没有说明 Vista 的要求。 Vista 时间杂志文章使用 HKLM 而不是 HKCU。我敢打赌就是这样。
The reg looks okayish, only the default progid is missing. Win7 does have documented alternate behavior for the location of the PreviewHandlers key. Unfortunately the SDK docs don't say what Vista requires. A Vista time magazine article uses HKLM instead of HKCU. I bet that's it.