资源管理器缩略图 (winXP)
我有一种文件格式需要能够在资源管理器缩略图中显示。 由于目标系统是Windows XP,因此Vista PreviewHandler API 不适合。 我将使用c++。
我该怎么做呢?
I have a file format I need to be able to show in explorer thumbnails. Since the target system is windows XP, the Vista PreviewHandler API will not be suitable. Ill be using c++.
How would I do it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您需要为您的文件类型注册一个 shell 扩展。 该扩展包含通过实现 IExtractImage 接口来提取/生成缩略图的代码。
请参阅:MSDN 上的 IExtractImage 接口
You'll need to register a shell extension for your file type. The extension contains code that extracts/generates the thumbnail by implementing the IExtractImage interface.
See: IExtractImage Interface on MSDN
https://github.com/reliak/moonpdf/tree/ master/ext/sumatra/src/previewer 是一个完美的例子。
为了构建 x86 和 x64 版本的 DLL,我使用带有 SP1 的 VS 2010 以及安装在 Windows 7 x64 上的 Win7 x64 SDK(针对
)。 构建的 DLL 在任意位数的 Win7 和 Win10 上都可以正常工作。另外,不要忘记
/MD
链接器标志,以避免需要在 WinXP 上安装 Microsoft Visual C++ 2010 Redistributable Package (x86)。可以将下一行添加到
"targetver.h"
中,以避免导入和使用较新版本的 Windows 系统 DLL 中的新函数(例如,WinXP 的RegDeleteTreeW
中没有RegDeleteTreeW
code>advapi.dll):此外它还实现了某些文件格式的预览器,但在您的实现中可以完全省略相关接口。
https://github.com/reliak/moonpdf/tree/master/ext/sumatra/src/previewer is perfect example.
To build both x86 and x64 versions of DLL I use VS 2010 with SP1 along with Win7 x64 SDK (for
<thumbcache.h>
) installed on Windows 7 x64. Builded DLLs works fine on Win7 and Win10 of either bitness.Also don't forget
/MD
linker flag to avoid necessity to install Microsoft Visual C++ 2010 Redistributable Package (x86) on WinXP.Next lines may be added to
"targetver.h"
to avoid import and using of new functions from newer versions of Windows system DLLs (say, there is noRegDeleteTreeW
in WinXP'sadvapi.dll
):Additionally it has implementation of previewer for some file formats, but related interfaces can be completely omitted in your implementation.