Change File Icons in C#

喜夏-厌秋 提交于 2019-12-23 22:29:14

问题


Can you suggest something for changing the files icons in C#? What I means here is that does C# has any class that we can use to change the icons of files. For example, can I replace notepad file icon with doc file icon in c#?

I know we can extract the icon of a file, but I am looking for applying new icon to a file.

let me try to explain it in details. I am working on a windows app that process files. This app creates a special folder and user can create files and folders into this folders. Now when user creates a files, i want to apply custom icon which shows it as under processing. When processing is done, the file icon will be changed to processing complete. I hope this makes sense now.

Thanks


回答1:


You will have to write custom shell extension for this. Which are known as "Icon Overlay Handlers". This is the same way by which applications like TortoiseSVN add icons in explorer.

See this MSDN article and this code example



来源:https://stackoverflow.com/questions/9292430/change-file-icons-in-c-sharp

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