图标覆盖处理程序的命名空间扩展 [英] icon overlay handlers for namespace extension

查看:773
本文介绍了图标覆盖处理程序的命名空间扩展的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发命名空间扩展,它给出服务器上文件的虚拟视图。在这个视图中,我需要使用叠加图标来提供文件的不同状态(使用中,离线,不同步等)。

I am developing namespace extension which gives a virtual view of files on a server. In this view, I need to provide different states(in use, offline, out of sync, etc) of a file using overlay icons.

我通过文章实现覆盖处理程序,并且我认为我将尝试在我们的重叠处理程序之一处理这个,它实现了IShellIconOverlayIdentifier接口。

I was read through article implementing overlay handler, and thought I will try to handle this in one of our overlay handlers, which implement IShellIconOverlayIdentifier interface.

我看到IShellIconOverlayIdentifier :: IsMemberOf函数仅在我访问正常文件系统上的文件时调用,即c:\,d:\等。当我浏览命名空间扩展时,这些调用根本不被调用。这是为什么?如何在命名空间扩展中为对象实现叠加层?

I see that IShellIconOverlayIdentifier::IsMemberOf(), and other functions are called only when I access files on normal filesystem, i.e., c:\, d:\ etc. When I browse a namespace extension, these calls are not called at all. Why is that? How do I implement overlays for objects in Namespace extension?

问候,
Madhu

regards, Madhu

推荐答案

添加叠加层图标的唯一方法是实施 IShellIconOverlay 。但问题是,IShellIconOverlay.GetOverlayIndex和IShellIconOverlay.GetOverlayIconIndex必须返回从 SHELL 图像列表接收的图标。可以使用SHGetIconOverlayIndex函数接收来自shell映像列表的覆盖图标。

The only way to add an overlay icon is implement IShellIconOverlay in your NSE. But the problem is that IShellIconOverlay.GetOverlayIndex and IShellIconOverlay.GetOverlayIconIndex must return icons received from SHELL image list. Overlay icons from shell image list can be received with SHGetIconOverlayIndex function. And there is NO way to add additional overlay icon into shell image list.

如果您想使用标准重叠图示(例如连结或分享图示),请使用只需使用SHGetIconOverlayIndex。但如果你想使用自定义图标,你必须使用黑客。 Hack是简单的额外的覆盖外壳扩展。只有覆盖外壳扩展可以添加额外的覆盖图标到shell映像列表中。在IShellIconOverlayIdentifier.GetOverlayInfo中,您将返回您的图标和索引,IShellIconOverlayIdentifier.IsMemberOf将始终返回S_FALSE。在NShell中,在IShellIconOverlay_GetOverlayIndex中,您将使用您的图标和索引调用SHGetIconOverlayIndex。

If you want to use standard overlay icons like link or share icons just use SHGetIconOverlayIndex. But if you want to use custom icons you must use "hack". Hack is simple additional overlay shell extension. Only overlay shell extension can add additional overlay icon into shell image list. In IShellIconOverlayIdentifier.GetOverlayInfo you will return your icon and index, IShellIconOverlayIdentifier.IsMemberOf always will return S_FALSE. Inside NSE in IShellIconOverlay_GetOverlayIndex you will call SHGetIconOverlayIndex with your icon and index.

您必须为每个图标使用单独的overlay shell扩展名。但不要忘记Windows在系统中注册的overlay shell扩展的最大计数的限制。我不记得确切的数字,但是约为15。

You must use separate overlay shell extension for every icon. But dont forget that Windows has limit of max count of overlay shell extension registered in the system. I dont remember exact number but it is about 15.

这篇关于图标覆盖处理程序的命名空间扩展的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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