Coerce Windows to show a thumbnail for my custom file type

五迷三道 提交于 2019-12-04 08:30:41

问题


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.

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?

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

Thanks! / Jakob


回答1:


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:

Creating Shell Extension Handlers



来源:https://stackoverflow.com/questions/2695411/coerce-windows-to-show-a-thumbnail-for-my-custom-file-type

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!