Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Coerce Windows to show a thumbnail for my custom file type

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

like image 654
Jakob Ryden Avatar asked Apr 23 '10 00:04

Jakob Ryden


People also ask

How do I get thumbnails to show files?

Step 1: Open Folder Options in Windows 10. While in File Explorer, click View tab, then double-click on Options in the ribbon. Step 2: Click View tab, uncheck Always show icons, never Thumbnails box. Then, click Apply.

How do I enable thumbnails in Windows 11?

Enable Windows 11 thumbnails. Open File Explorer, select the three-dot menu at the top of the window > View, and make sure Always show icons, never thumbnails is deselected. Having this option enabled will turn off thumbnails and replace them with generic file type icons. Restore File Explorer default settings.


1 Answers

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

like image 197
Wade Tandy Avatar answered Oct 21 '22 20:10

Wade Tandy