如何使用 IExplorerCommand 接口创建级联菜单

向级联菜单添加谓词的另一个选项是通过 IExplorerCommand::EnumSubCommands。 此方法允许通过 IExplorerCommandProvider 接口提供其命令模块命令的数据源将这些命令用作快捷菜单上的谓词。 在 Windows 7 及更高版本中,可以使用 IExplorerCommand 接口提供与 IContextMenu 接口相同的谓词实现。

Instructions

以下两个屏幕截图演示了在 “设备” 文件夹中使用级联菜单。

显示 devices 文件夹中级联菜单示例的屏幕截图。

显示 devices 文件夹中级联菜单示例的屏幕截图

备注

注意

由于 IExplorerCommand 仅支持进程内激活,因此建议由需要在命令和快捷菜单之间共享实现的 Shell 数据源使用。

 

IExplorerCommand

IExplorerCommandProvider

IContextMenu