【问题标题】:set overlay Icon to running explorer without restart将覆盖图标设置为运行资源管理器而不重新启动
【发布时间】:2015-01-14 09:39:50
【问题描述】:

我想根据某些状态更改文件的覆盖图标。 如果文件状态改变,覆盖图标应该改变。 例如:如果文件被锁定,应该设置与锁定相关的覆盖图标,如果释放它应该设置不同的覆盖图标。

【问题讨论】:

标签: visual-c++ overlay explorer shell-extensions


【解决方案1】:

要设置覆盖图标需要实现IShellIconOverlayIdentifier interface

registry 中写入注册表项以进行COM dll 注册,另外一个registry 需要覆盖图标标识符注册,请参见下文:

Key:"HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Explorer\ShellIconOverlayIdentifiers\TestShellIconOverlayIdentifiers"
with default value [CLSID_of_registered_DLL]

在此之后,一些函数需要在注册时调用,以便在已经运行的资源管理器实例的系统内存中插入覆盖图标,我在下面的帖子中找到了答案。 How can I programmatically refresh Windows Explorer?

TortoiseCVS - ShellUtils.cpp上查看函数"bool RebuildIcons()"

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-03-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-12-03
    • 2011-01-12
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多