开发者

Override file icon in windows shell/explorer

开发者 https://www.devze.com 2023-01-07 12:32 出处:网络
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 开发者_如何

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).

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号