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.
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).
精彩评论