David Rutten
David Rutten

Reputation: 4806

Override file icon in windows shell/explorer

Is there a way to override the icon and/or preview of a specific file format (my own) in Windows Explorer using C#? My files are xml files that contain a base-64 image, I'd like to display this image in Explorer as the file icon.

Upvotes: 1

Views: 707

Answers (1)

Stephen Cleary
Stephen Cleary

Reputation: 457422

You need to implement a thumbnail shell extension. There's an older MSDN article that addresses writing shell extensions in general (though it doesn't specifically address thumbnail shell extensions).

Note that this was not possible pre-.NET 4.0 (hence the editor's note on the MSDN article). I originally thought that you would have to target .NET 4.0 for it to work, but according to Peter Ritchie's blog post on the subject, you could target any version (.NET 4.0 just has to be installed).

Upvotes: 2

Related Questions