强制 Windows 显示我的自定义文件类型的缩略图 [英] Coerce Windows to show a thumbnail for my custom file type

查看:28
本文介绍了强制 Windows 显示我的自定义文件类型的缩略图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用 C# 中的 windows OpenFileDialog 类来浏览我的应用程序的文件.然后,我希望文件在 Windows 的缩略图"视图中显示预览.

I want to use the windows OpenFileDialog class in C# to browse files for my application. I would then like the files to show up with previews in Windows' "thumbnails" view.

有没有一种简单的方法可以做到这一点?我认为应该有一种方法来对文件进行编码,以便 Windows 只需读取和显示缩略图信息,即使它是不受支持的文件类型?

Is there a simple way to make this happen? I'm thinking there should be a way to encode the files so that Windows simply reads and displays the thumbnail information, even though it's an unsupported file type?

我知道 Windows Vista 具有与 Windows XP 不同的界面(IThumbnailProvider,而不是 IExtractImage),但我需要它跨平台工作.

I know Windows Vista has a different interface (IThumbnailProvider as opposed to IExtractImage) than Windows XP, but I need it to work across platforms.

谢谢!/雅各布

推荐答案

您必须编写一个 Shell 扩展处理程序缩略图提取器.这是非托管 C++ 代码,它从您的自定义文件类型中提取图像以在资源管理器外壳中显示.您可以在以下链接中找到有关 Shell 扩展处理程序的更多信息:

You have to write a Shell Extension Handler Thumbnail Image Extractor. This is unmanaged c++ code that extracts the image from your custom filetype to display within explorer shell. You can find more about Shell Extension Handlers at the following link:

创建 Shell 扩展处理程序

这篇关于强制 Windows 显示我的自定义文件类型的缩略图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆