Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 280
Santiago Corredoira Avatar asked Sep 02 '08 15:09

Santiago Corredoira


People also ask

How do I add to Explorer context menu?

Right-click (or select and hold) on a file or folder to open the context menu. Select Show more options.

How do I customize Windows context menu?

Press the Windows key and R simultaneously, type regedit and press Enter. Navigate to HKEY_CLASSES_ROOT\*\shellex\ContextMenuHandlers and you will see a series of keys that related to existing menu entries. It is easy to delete any you no longer need access to – just right click a key and select Delete.


2 Answers

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.

like image 181
Aardvark Avatar answered Sep 28 '22 07:09

Aardvark


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

like image 28
HiDiHo Avatar answered Sep 28 '22 07:09

HiDiHo