作者热门文章
- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
当使用 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/
COW 不是奶牛,是 Copy-On-Write 的缩写,这是一种是复制但也不完全是复制的技术。 一般来说复制就是创建出完全相同的两份,两份是独立的: 但是,有的时候复制这件事没多大必要
我是一名优秀的程序员,十分优秀!