在 Windows 资源管理器上下文菜单中添加分隔符(不在子菜单中)

Add a separator in the Windows Explorer context menu (not in a submenu)

我发现 "CommandFlags"=dword:00000040 会在条目下方添加一个分隔符,但只添加到子菜单(在 "subcommands"="" 字符串下方)。示例 here.

有没有办法在主上下文菜单中添加分隔符?

我使用的例子:

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

这里没有分隔符。

您好,我是您提到的博客条目的作者 (https://blog.sverrirs.com/2014/05/creating-cascading-menu-items-in.html)

您操作主上下文菜单的选项非常有限。 MSDN documentation 表示您可能只能对 top-level 项使用 ECF_SEPARATORBEFORE (0x20) 值。

此示例在项目前后都有分隔符,此条目适用于 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"=""

对于通过 shellex 加载的其他应用程序,不可能在注册表上添加分隔符,注入的 dll add/remove 分隔符本身,然后您需要更改 dll 代码并重新编译它以实现您想要的,这里是记事本++的例子 https://github.com/notepad-plus-plus/notepad-plus-plus/pull/3092/commits

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