确定 Windows shell 上下文菜单扩展条目的顺序

问题描述 投票:0回答:1

我正在尝试实现一个 shell 扩展,该扩展在 Windows 10/11 上下文菜单中显示多个条目。我的很多解决方案都基于此示例:https://github.com/microsoft/AppModelSamples/tree/master/Samples/SparsePackages

这意味着我正在使用 IExplorerCommand 来实现不同的命令处理程序:https://learn.microsoft.com/en-us/windows/win32/api/shobjidl_core/nn-shobjidl_core-iexplorercommand

目前,在我的 AppxManifest.xml 文件中,对于目录项类型,我有类似于以下条目的内容:

  <desktop4:FileExplorerContextMenus>
    <desktop5:ItemType Type="Directory">
      <desktop5:Verb Id="FirstIdString" Clsid="MY-CLSID"/>
      <desktop5:Verb Id="SecondIdString" Clsid="MY-CLSID"/>
      <desktop5:Verb Id="ThirdIdString" Clsid="MY-CLSID"/>
      <desktop5:Verb Id="FourthIdString" Clsid="MY-CLSID"/>
    </desktop5:ItemType>

在实际的上下文菜单中,条目的显示顺序与我在此处声明的顺序不同。我将如何操作上下文菜单条目的索引/顺序?

c++ windows contextmenu shell-extensions appxmanifest
1个回答
0
投票

事实证明,上下文菜单项是根据desktop5:Verb 节点的Id 属性的字符串值进行排序和分组的。这似乎没有记录在架构参考中。

© www.soinside.com 2019 - 2024. All rights reserved.