ShellIconOverlayIdentifiers - 为什么这么少?

发布于 2024-10-06 21:54:47 字数 391 浏览 5 评论 0原文

此时,每个人都知道 ShellIconOverlayIdentifiers 的数量是有限制的(来自 MSDN):

系统可以支持的不同图标覆盖处理程序的数量受到系统图像列表中可用于图标覆盖的空间量的限制。目前有十五个插槽分配给图标覆盖,其中一些是系统保留的。因此,只有在没有令人满意的替代方案时才应实现图标覆盖处理程序

我可以理解 Windows 95 中的 15 个覆盖限制)。但是在有 Gig RAM、大量内核和 GPU 的环境中,是否存在某些技术原因现代操作系统中的数字这么低?

为什么这个值不可配置?

在给出“性能”答案之前,请考虑: Windows 允许进行配置,这样您就可以降低性能...为什么要专门针对这个问题呢?

At this point, everyone knows that there's a limit to the number of ShellIconOverlayIdentifiers (from MSDN):

The number of different icon overlay handlers that the system can support is limited by the amount of space available for icon overlays in the system image list. There are currently fifteen slots allotted for icon overlays, some of which are reserved by the system. For this reason, icon overlay handlers should be implemented only if there are no satisfactory alternatives

I can understand the 15 overlay limt in Windows 95. But in an environment where there's Gigs of RAM, numerous Cores, and GPUs, is there some technical reason for such a low number in a modern operating system?

And why isn't this value configurable?

Before giving the 'performance' answer, consider:
Windows allows for configuration such that you can kill performance... why pick on this issue specifically?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

冷夜 2024-10-13 21:54:47

除非这里有人碰巧在 Windows Shell 团队工作,否则我怀疑您是否会得到真正解决技术限制以及它们如何影响设计选择的答案。但我会尝试...

我的猜测是没有任何技术限制,或者至少现在没有。 真正的原因大概是没有人花时间坐下来更新代码、设计和规范来解除这一限制。默认情况下不会实现功能,只是因为过去几年计算环境发生了变化,但这并不意味着有人坐下来重写 Windows 以充分利用所有这些变化。

您还应该考虑到这很可能是一个有意识的设计选择,而不是强加的限制。Raymond Chen(实际上确实在 shell 团队工作)发表了博客条目回应有关 Windows 7 删除“分享之手”叠加。他提出了一个令人信服的论点,即图标叠加实际上并不是显示信息的理想方式(除此之外,系统仅限于 15 个)[强调]:

一般来说,叠加层不是
呈现信息的好方法
因为只能有一个叠加层
每个图标
,限制为 15 个
每个 ImageList 叠加。 如果有
两个或多个叠加层适用于
项目,然后一个人获胜,其他人获胜
将失去,此时的价值
覆盖作为确定的一种方式
哪些属性适用于某个项目
减少
因为唯一的方法是
确定缺少某个属性的是
当你根本看不到叠加层时。 (如果
您会看到其他一些叠加层,但看不到
告诉我是否是因为你的
财产丢失或因此
显示其他叠加层而不是
你的。)

对我来说,在大多数现实情况下,添加到 shell 中的额外混乱根本不值得,这似乎是合理的。 Windows Shell 团队显然也得出了同样的结论,并删除了“共享之手”覆盖层。雷蒙德的直接解释:

考虑到人们使用方式的变化
计算机,共享信息
越来越默认
状态。当您设置家庭组时,
几乎一切都会发生
共享。为了消除视觉上的混乱,
该信息已移至
详细信息窗格。

而且,我知道您特别要求不要提及性能,但 Windows 确实试图防止您搬起石头砸自己的脚。用户要求 shell 的响应能力,并且覆盖图标可能会干扰这一点。作为进一步证明它们不是优先事项的证据,另一篇博客文章由同一雷蒙德·陈 (Raymond Chen) 责骂:

应用程序的另一个例子
自私的绩效观出现了
来自一家开发图标的公司
覆盖处理程序。外壳处理
重叠计算作为低优先级
项,因为更重要的是
获取屏幕上的图标,以便用户
可以开始做任何他们想做的事
想做的事。装饰品
可以晚点来。这家公司想要
知道是否有办法可以
提高他们的表现并获得
他们甚至覆盖在屏幕上
在图标出现之前,
表现出极其自私的一面
“表现”的解释。

Unless someone here happens to work on the Windows Shell team, I doubt that you're going to get an answer that really addresses the technical limitations and how they affect the design choice. But I'll try...

My guess is that there isn't any technical limitation, or at least there isn't one now. The real reason is presumably that no one has ever taken the time to sit down and update the code, the design, and the spec to lift this limitation. Features aren't implemented by default, and just because the computing environment has changed in the last few years doesn't mean that someone sat down and rewrote Windows to take full advantage of all those changes.

You should also consider that is more than likely a conscious design choice, rather than an imposed limitation. Raymond Chen (who actually does work on the shell team) published a blog entry responding to the uproar about Windows 7 removing the "sharing hand" overlay. He makes a compelling argument that the icon overlay is really not a desirable way of showing information (above and beyond the fact that the system is limited to 15) [emphasis added]:

Generally speaking, overlays are not a
good way of presenting information
because there can be only one overlay
per icon
, and there is a limit of 15
overlays per ImageList. If there are
two or more overlays which apply to an
item, then one will win and the others
will lose, at which point the value of
the overlay as a way of determining
what properties apply to an item
diminishes
since the only way to be
sure that a property is missing is
when you see no overlay at all. (If
you see some other overlay, you can't
tell whether it's because your
property is missing or because that
other overlay is showing instead of
yours.)

It seems reasonable to me that the extra clutter added to the shell is simply not worth it in the majority of real-world cases. The Windows Shell team obviously reached the same conclusion and cut the "sharing hand" overlay. Raymond's direct explanation:

Given the changes in how people use
computers, sharing information is
becoming more and more of the default
state. When you set up a HomeGroup,
pretty much everything is going to be
shared. To remove the visual clutter,
the information was moved to the
Details pane.

And, I know you specifically asked not to mention performance, but Windows really does try to keep you from shooting yourself in the foot. Users demand responsiveness in the shell, and overlay icons can interfere with this. As further evidence that they are not the priority, another blog post by the same Raymond Chen chastises:

Another example of applications having
a selfish view of performance came
from a company developing an icon
overlay handler. The shell treats
overlay computation as a low-priority
item, since it is more important to
get icons on the screen so the user
can start doing whatever it is they
wanted to be doing. The decorations
can come later. This company wanted to
know if there was a way they could
improve their performance and get
their overlay onto the screen even
before the icon shows up,
demonstrating a phenomenally selfish
interpretation of "performance".

凡尘雨 2024-10-13 21:54:47

科迪对实际问题做出了出色的回应。至于为什么是 15 而不是其他数字,该限制已纳入 ImageList 控件本身。

Excellent response on the practical issues by Cody. As to why 15 and not some other number, the limit is baked into the ImageList control itself.

小鸟爱天空丶 2024-10-13 21:54:47

正如科迪·格雷所解释的那样,这一切都非常好,但坦率地说,这非常缺乏想象力,而且正如幕后报道的那样,听起来有点沮丧。

在 2015 年的 Windows 10 中,肯定可以而且需要有更好的功能,因为我注意到存在大约 30 个覆盖层,并且必须优先考虑我最想看到的覆盖层,这根本不是你希望大多数人担心的。我还看到像 Box 这样激进的供应商过度竞争,试图优先考虑自己,而这永远不会有任何好处。

这是一种可能性:如果多重重叠的图标有一个通用的重叠指示器会怎样?像 Google Chrome Apps 按钮一样的多种颜色的小矩形矩阵?单独覆盖只会显示长列表中的覆盖。

然后,当鼠标指针遇到图标时,一个小的弹出窗口会收集所有要查看的图标变体(以小图标大小或稍大一点)。当您将鼠标悬停在每个重叠的图标上时,会通过工具提示依次宣布其含义。

现在,您可以拥有所需的所有图标覆盖,用于各种云中的状态、用于 Tortoise 工具的存储库指示等等。

This is all very well and good, as explained by Cody Gray, but frankly it is pretty unimaginative, and as reported behind the scenes, sounding a bit frustrated.

In 2015 and with Windows 10, surely there can and needs to be a better ability, as I noted about thirty overlays present and had to prioritize ones I wanted most to see, which is not what you want most people to worry about at all. Also I see aggressive vendors like Box over-competing to try to prioritize themselves, and that will never go any place good.

Here's a possibility: What if multiply overlaid icons had a generic overlay indicator; a small rectangle matrix of multiple colors like the Google Chrome Apps button? Singly overlaid would just show the overlay out of a long list.

Then when the mouse pointer meets the icon, a small flyout window collects all the icon variations to view (at small icon size or a little larger). Each overlaid icon in turn announces by tooltip what it is, when you mouse over.

Now you can have all the icon overlays you need, for state in various clouds, for repository indications as for Tortoise tools, and so forth.

貪欢 2024-10-13 21:54:47

我在这里引用了 为什么有 15 的限制shell 图标叠加? Raymond Chen 2019 帖子

值 15 来自图像列表的相应限制。这
ImageList_SetOverlayImage函数最多支持15个图像列表
每个图像列表叠加。 (嘿,以前的情况更糟。以前的限制
只有 3 个!)

好的,但为什么只有 15 个?为什么不多呢?

覆盖图像是在以下情况下使用的信息之一:
从图像列表中绘制图像。选项被编码在
fStyle 参数,以及当这些位被划分为各种
目的,四个位可用于指定覆盖
图像。 (您会得到 15 个重叠图像,而不是 16 个,因为您丢失了一个
值以指定“无覆盖”。)

好的,但是 fStyle 参数中的值仅使用后 16 位
位。那么高 16 位呢?那里有足够的空间。

16 位限制是从 16 位版本继承的
通用控件(Windows 95 中仍需要支持)。的
当然,现在没有人关心通用的 16 位版本
控件,那么为什么不开始使用高位呢?

有一个令人不满意的解释:内部管理的代码
fStyle 在某些地方仍然使用 WORD,因此所有代码
管理 fStyle 必须进行修改。这种情况发生在多个
跨 Windows 的模块,因此必须进行同步更改
跨多个组件。这是二进制文件的重大更改
级别,因为接口不再兼容。打破
更改在程序上很难协调:受影响的代码
shell 团队可能看不到他们,因为他们坐在
尚未 RI 到树干的远方叶枝。可能是
将 fStyle 从 WORD 扩展到 DWORD 具有深远的影响
对某些组件的影响。

就像我说的,这并不令人满意。基本上可以归结为“它
工作量很大,而且我们很懒。”

I quote an extract of the definitive answer here from Why is there a limit of 15 shell icon overlays? Raymond Chen 2019 post

The value 15 came from the corresponding limit for image lists. The
Image­List_Set­Overlay­Image function supports up to 15 image list
overlays per image list. (Hey, it used to be worse. The limit used to
be only 3!)

Okay, but why only 15? Why not more?

The overlay image is one of the pieces of information used when
drawing an image from an image list. The options are encoded in the
fStyle parameter, and when the bits were divided up for various
purposes, four bits were available to be used to specify the overlay
image. (You get 15 overlay images instead of 16 because you lose one
of the values in order to specify “no overlay.”)

Okay, but the values in the fStyle parameter use only the bottom 16
bits. What about the upper 16 bits? There’s plenty of room there.

The 16-bit limit was carried over from the 16-bit version of the
common controls (which still needed to be supported in Windows 95). Of
course, nowadays, nobody cares about the 16-bit version of the common
controls, so why not start using the upper bits?

There’s an unsatisfying explanation: The code internally that manages
the fStyle still uses a WORD in some places, so all the code that
manages the fStyle would have to be revised. This occurs in multiple
modules across Windows, so a synchronized change would have to be made
across multiple components. This is a breaking change at the binary
level because the interfaces are no longer compatible. Breaking
changes are procedurally difficult to coordinate: The affected code
may not be visible to the shell team because they are sitting in a
far-away leaf branch that has not yet RI’d to the trunk. It might be
that expanding fStyle from a WORD to a DWORD has far-reaching
consequences for some component.

Like I said, this is unsatisfying. Basically it boils down to “It
would be a lot of work and we are lazy.”

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文