Add a separator in the Windows Explorer context me

2020-07-17 07:41发布

问题:

I have found that "CommandFlags"=dword:00000040 will add a separator below an entry, though only to a submenu (under the "subcommands"="" string). Example here.

Is there a way to add a separator in the main context menu?

The example I am using:

[HKEY_CLASSES_ROOT\AllFilesystemObjects\shell\Delete With Rimraf]
@="Delete With Rimraf"
"CommandFlags"=dword:00000040

This gives no separator.

回答1:

This example feature a separator after and before the item, this entry is for VirusTotal Uploader

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\*\shell\vtuploader]
@="Send to VirusTotal"
"Icon"="C:\\Program Files\\VirusTotalUploader2\\VirusTotalUploader2.2.exe,0"
"SeparatorBefore"=""
"SeparatorAfter"=""

For other applications loaded over shellex it's not possible to add separator over registry, the injected dll add/remove separator itself, you need then to change the dll code and recompile it to achieve what you want here is an example with notepad++ https://github.com/notepad-plus-plus/notepad-plus-plus/pull/3092/commits

InsertMenu(hMenu, nIndex, MF_STRING | MF_BYPOSITION, idCmd++, m_szMenuTitle);


回答2:

Hi I'm the author of the blog entry you refer to (https://blog.sverrirs.com/2014/05/creating-cascading-menu-items-in.html)

Your options to manipulate the main context menu are quite restricted. The MSDN documentation indicates that you might only be able to use the ECF_SEPARATORBEFORE (0x20) value for top-level items.