How to add submenu items to the Windows Explorer context menu?

こ雲淡風輕ζ 提交于 2019-12-21 17:20:04

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!