gpt4 book ai didi

c++ - 如何使用基于 IExecuteCommand 的 shell 扩展使某些上下文菜单选项变灰?

转载 作者:可可西里 更新时间:2023-11-01 11:51:31 25 4
gpt4 key购买 nike

当使用 IExecuteCommand 方法(如 this blog post 中所述)实现上下文菜单 shell 扩展时,给定的菜单选项如何变灰?

例如假设 shell 扩展提供了一些菜单选项,其中一些应该基于 shell 扩展计算的某些状态和条件而变灰,例如:如果用户右键单击一个文件并且 shell 扩展检测到该文件有一些给定的属性,一些 shell 扩展上下文菜单选项应该变灰。

如何使用 IExecuteCommand 做到这一点?

或者是否应该为此目的使用另一个 Windows Shell COM 接口(interface)?

最佳答案

我从来没有尝试过这个,但你应该能够在你的动词键中将 CommandStateHandler(未记录?)设置为实现 IExplorerCommandState 的 CLSID。 .

您可能还会考虑实现 IExplorerCommand而不是 IExecuteCommand+IExplorerCommandState...

您还可以根据对具有 AppliesTo 值的属性系统的查询来隐藏动词。

关于c++ - 如何使用基于 IExecuteCommand 的 shell 扩展使某些上下文菜单选项变灰?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28197401/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com