更改文件图标在C# [英] Change File Icons in C#

查看:192
本文介绍了更改文件图标在C#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你可以建议一些改变C#中的文件图标吗?我这里的意思是,C#有任何类,我们可以用来更改文件的图标。例如,我可以用doc文件图标替换记事本文件图标在c#?

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.

让我尝试详细解释一下。我正在处理一个Windows应用程序处理文件。此应用程序创建一个特殊的文件夹,用户可以创建文件和文件夹到这个文件夹。现在,当用户创建一个文件,我想应用自定义图标显示为正在处理。处理完成后,文件图标将更改为处理完成。

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.

感谢

推荐答案

必须为此编写自定义外壳扩展。这被称为图标覆盖处理程序。这与TortoiseSVN等应用程序在浏览器中添加图标的方式相同。

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.

查看此 MSDN文章此代码示例

这篇关于更改文件图标在C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆