When implementing a context-menu shell extension using the IExecuteCommand
approach (as described in this blog post), how can a given menu option be grayed out?
E.g. Suppose that the shell extension offers some menu options, and some of them should be grayed out basing on some state and conditions that the shell extension computes, for example: if the user right-clicks on a file and the shell extension detects that this file has some given properties, some of the shell extension context menu options should be grayed out.
How to do that using IExecuteCommand
?
Or should another Windows Shell COM interface be used for that purpose?