Dha*_*tel 3 windows-registry windows-explorer
我想编辑 Windows 资源管理器的上下文菜单。我想用子菜单创建我自己的菜单,如图所示。并执行一些任务,例如复制并移动到其他目的地。任何人都可以告诉我如何使用注册表来做到这一点。
这可能吗?如果可能,请给我一步一步的答案。
Folder/file
-->Right click
-->List of menu(Open,copy,send to,My menu name)
-->My menu name ->(Copy,Move)
-->copy -->list of "fixed" folders or destination names
(They are already in my Hard disk)
(On click on it it will perform copy operation).
Run Code Online (Sandbox Code Playgroud)
只是我想在上下文菜单中制作子菜单。和复制和移动操作,我想显示我在我的任何驱动器中创建的文件夹。并且有人单击该文件夹它将执行复制操作。
在 Windows 7 及更高版本中,您可以直接通过注册表创建静态菜单。
由于
HKEY_CLASSES_ROOT
是组合HKEY_CURRENT_USER
并HKEY_LOCAL_MACHINE
,可以注册在任何自定义谓词HKEY_CURRENT_USER\Software\Classes
子项。这样做的主要优点是不需要提升权限。来源:创建快捷菜单处理程序
这是您可以使用的每用户注册表模板。只需将其粘贴到一个新的文本文档中,然后应用您需要的更改。然后将其另存为.reg
文件,并将其合并到注册表中。自定义菜单将添加到所有文件和文件夹中。
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"
Run Code Online (Sandbox Code Playgroud)
- 该
AttributeMask
值指定要测试的掩码位值的SFGAO值。- 该
AttributeValue
值指定被测试位的SFGAO值。- 所述
ImpliedSelectionModel
指定零为项动词,或非零的背景快捷菜单上的动词。来源:创建快捷菜单处理程序
在上面的模板中,AttributeMask
和AttributeValue
分别设置为0x00000001
和0x00000002
。这些值与SFGAO_CANCOPY
和SFGAO_CANMOVE
常量相关联,它们确定是否可以复制/移动指定的项目。
归档时间: |
|
查看次数: |
3859 次 |
最近记录: |