打造自己的右键层叠菜单

  • 格式:docx
  • 大小:564.97 KB
  • 文档页数:2

首先看一下效果:
看到上面的效果了,现在开始制作文本编辑菜单,打开注册表regedit:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\*\shell\RuanMeiMenu] "SubCommands"="RuanMeiMenu.0;RuanMeiMenu.1;RuanMeiMenu.2;RuanMeiMenu.3;RuanM eiMenu.4"
"MUIVerb"="文本编辑"
"icon"="notepad.exe"
解释一下:
[HKEY_CLASSES_ROOT\*\shell\RuanMeiMenu]打开注册表HKEY_CLASSES_ROOT\*\shell新建一个项RuanMeiMenu,这个名称可以随便写。

"SubCommands"="RuanMeiMenu.0;RuanMeiMenu.1;RuanMeiMenu.2;RuanMeiMenu.3;RuanM eiMenu.4"层叠菜单名称,这里是5个菜单,取了5个名称,层多少个就加多少。

"MUIVerb"="文本编辑"右键菜单名称。

"icon"="notepad.exe"显示图标,可自己指定,这里用了记事本的图标。

第一级菜单已经完成,第二级菜单:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandSto re\shell\RuanMeiMenu.0]
@="用\"Vim\"打开"
"icon"="C:\\Program Files\\vim\\Vim\\vim73\\vim.exe"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandSto re\shell\RuanMeiMenu.0\command]
@="C:\\Program Files\\vim\\Vim\\vim73\\vim.exe %1"
解释一下:
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandSto re\shell\RuanMeiMenu.0]找到HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandSto re\shell项新建RuanMeiMenu.0项,这个名称一定要与上级子菜单名称一致,否则后果自负。

@="用\"Vim\"打开",菜单显示名称,RuanMeiMenu.0默认值。

输入用”Vim”打开即可。

"icon"="C:\\Program Files\\vim\\Vim\\vim73\\vim.exe"新建icon字符串值,内容,为图标所在路径,这里使用了vim自带图标。

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandSto re\shell\RuanMeiMenu.0\command]这个就是在RuanMeiMenu.0项下建一个command项。

@="C:\\Program Files\\vim\\Vim\\vim73\\vim.exe %1"在默认值里输入要执行的软件。