Criando menus em cascata
No Windows 7 e posterior, você pode criar menus estáticos diretamente por meio do registro.
Because
HKEY_CLASSES_ROOTis a combination ofHKEY_CURRENT_USERandHKEY_LOCAL_MACHINE, you can register any custom verbs under theHKEY_CURRENT_USER\Software\Classessubkey. The main advantage of doing so is that elevated permission is not required.Source: Creating Shortcut Menu Handlers
Modelo de registro
Aqui está um modelo de registro por usuário que você pode usar. Basta colá-lo em um novo documento de texto e aplicar as alterações necessárias. Em seguida, salve-o como um arquivo .reg e mescle-o no registro. O menu personalizado será adicionado a todos os arquivos e pastas.
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Classes\*\shell\MyMenu]
"MUIVerb"="My menu name"
"Position"="Bottom"
"SubCommands"=""
[HKEY_CURRENT_USER\Software\Classes\*\shell\MyMenu\shell\cmd1]
@="Copy"
"AttributeMask"=dword:00000001
"AttributeValue"=dword:00000001
"ImpliedSelectionModel"=dword:00000000
"MUIVerb"="@shell32.dll,-31246"
[HKEY_CURRENT_USER\Software\Classes\*\shell\MyMenu\shell\cmd1\command]
@="copy command here"
[HKEY_CURRENT_USER\Software\Classes\*\shell\MyMenu\shell\cmd2]
@="Move"
"AttributeMask"=dword:00000002
"AttributeValue"=dword:00000002
"ImpliedSelectionModel"=dword:00000000
"MUIVerb"="@shell32.dll,-4145"
[HKEY_CURRENT_USER\Software\Classes\*\shell\MyMenu\shell\cmd2\command]
@="move command here"
[HKEY_CURRENT_USER\Software\Classes\Folder\shell\MyMenu]
"MUIVerb"="My menu name"
"Position"="Bottom"
"SubCommands"=""
[HKEY_CURRENT_USER\Software\Classes\Folder\shell\MyMenu\shell\cmd1]
@="Copy"
"AttributeMask"=dword:00000001
"AttributeValue"=dword:00000001
"ImpliedSelectionModel"=dword:00000000
"MUIVerb"="@shell32.dll,-31246"
[HKEY_CURRENT_USER\Software\Classes\Folder\shell\MyMenu\shell\cmd1\command]
@="copy command here"
[HKEY_CURRENT_USER\Software\Classes\Folder\shell\MyMenu\shell\cmd2]
@="Move"
"AttributeMask"=dword:00000002
"AttributeValue"=dword:00000002
"ImpliedSelectionModel"=dword:00000000
"MUIVerb"="@shell32.dll,-4145"
[HKEY_CURRENT_USER\Software\Classes\Folder\shell\MyMenu\shell\cmd2\command]
@="move command here"
Observações
- The
AttributeMaskvalue specifies the SFGAO value of the bit values of the mask to test with.- The
AttributeValuevalue specifies the SFGAO value of the bits that are tested.- The
ImpliedSelectionModelspecifies zero for item verbs, or nonzero for verbs on the background shortcut menu.Source: Creating Shortcut Menu Handlers
No modelo acima, os AttributeMask e AttributeValue estão definidos como 0x00000001 e 0x00000002 , respectivamente. Esses valores estão associados às constantes SFGAO_CANCOPY e SFGAO_CANMOVE , que determinam se os itens especificados podem ser copiados / movidos.