临时更改文件夹/文件的图标 [英] Temporarily change icon of a folder/file

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

问题描述

我想知道.net中是否有一种方法可以将文件夹/文件的图标临时更改为不同于常规文件/文件夹的图标.我正在创建一个需要监视文件夹/文件内活动的应用程序,这可以通过FileSystemWatcher来实现,但是我的要求是,在监视文件/文件夹时,它会带有一个勾号"来更改其图标.我不知道除了默认的Windows图标之外,是否还可以将图标临时更改为绿色的勾号,我不需要为所有此类文件类型在Windows注册表中更改文件显示图标.

I wonder if there is a way in .net to temporarily change icon of a folder/file to something different than regular file/folder icon. I am creating an application that reqires to monitor activities inside folder/file, this can be achieved by FileSystemWatcher but my requirement is to change the icon of the files/folder with a Tick Mark when it is monitored. I wonder if there is a way to temporarily change the icon to green tick mark in addition to the default windows icon , I do not need to change the file display icons in windows registry for all such file types.

推荐答案

您将必须编写一个"Shell Extension",特别是一个"Overlay Icon". 此处的描述方式 [ P/调用 [ ^ ]签名.
You''ll have to write a "Shell Extension", specifically an "Overlay Icon". How is described here[^]. If you want to do it from C#, you''ll also need the P/Invoke[^] signature.


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

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