【发布时间】:2016-04-20 19:09:45
【问题描述】:
我创建了一个应用程序来帮助维护在办公室中使用的文件夹/文件路径格式。当 exe 最初以管理员模式运行时,应用程序将注册表实体添加到 HKEY_CLASSES_ROOT\AllFileSystemObjects\shell\PathStructure 路径,并将子项添加到 HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\,其中 PathStructure 是应用程序的名称,子项是键控的用 PathStructure.* 用 * 替换为命令名称。
在浏览 Windows 资源管理器时,这完全可以正常工作,并且命令按预期工作。但是,在打开或保存对话框中导航时,仅显示根菜单项 路径结构,并且子菜单不会在非 Microsoft 应用程序中层叠。始终有效的子菜单的一个很好的例子是 Send to 菜单项,它在我测试过的每个对话框中都正确级联。
这是一个子项目注册实体的示例(来自 CommandStore):
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\PathStructure.Add.All]
"MUIVerb"="Create All main folders"
"icon"="%windir%\\system32\\shell32.dll,278"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\PathStructure.Add.All\command]
@="\"\\\\{Network Path}\\Path Structure Maintenance.exe\" -addall \"%1\""
这是主节点的注册实体:
[HKEY_CLASSES_ROOT\AllFilesystemObjects\shell\PathStructure]
"MUIVerb"="Path Structure"
"SubCommands"="PathStructure.Open;PathStructure.Add;PathStructure.Format;PathStructure.Audit;PathStructure.Clipboard;PathStructure.TransferByExtension;PathStructure.Preview;"
"icon"="%windir%\\system32\\imageres.dll,153"
我是否遗漏了任何可以让我通过对话框访问子菜单的参数?我的子项目是否在注册表的错误部分?还是我最好潜入开发上下文处理程序?
【问题讨论】:
标签: vb.net windows shell contextmenu