问题
I can create a menu item in the Windows Explorer context menu by adding keys in the registry to HKEY_CLASSES_ROOT\Folder\shell.
How can I create submenu items to the just created menu item?
回答1:
I believe anything non-trival you'll have to create a Context Menu Handler.
You'll have to create a COM object that will create the menus and carry out the commands as they're clicked. I've only done this using C++ and COM. I'm not sure if there are easier ways to do this.
回答2:
Use SubCommands "SubCommands"="[NameOfMenu]"
Example for creating submenu for .TS files:
[HKEY_CLASSES_ROOT\SystemFileAssociations\.ts\shell\Encoding]
"MUIVerb"="Encoding video"
"SubCommands"="Encodex265Fade;EncodeTS2;watched"
"icon"="imageres.dll,-149"
"Position"=-
"MultiSelectModel"="Single"
"NeverDefault"=""
;"ExtendedSubCommandsKey"="Encode\\Fadein"
;"Icon"="C:\\Program Files (x86)\\CloudMe\\CloudMe\\favicon.ico"
More info: https://msdn.microsoft.com/en-us/library/windows/desktop/hh127431(v=vs.85).aspx
来源:https://stackoverflow.com/questions/39734/how-to-add-submenu-items-to-the-windows-explorer-context-menu