文件夹右键菜单(仅限文件夹)

时间:2009-10-08 13:26:24

标签: c# shell directory contextmenu

请参阅this。我应该在示例中使用什么代替“Jpegfile”来表示文件夹? 我不想要驱动器,回收站,计算机(我在XP中的计算机),我的文档(在xp中)等。也被包括在内。我希望我的右键菜单条目仅添加到文件夹的右键菜单中。 感谢致敬。 请注意:我不能使用“文件夹”,因为它也包含了回收站。 AKGMA

3 个答案:

答案 0 :(得分:2)

您所谈论的“文件夹”实际上是目录;包含文件的那些。请参阅Windows上下文中的Difference between a Directory and a Folder

要让您的右键单击上下文菜单条目仅显示目录,请将其添加到

[HKEY_CLASSES_ROOT\Directory\shell\]

而不是

[HKEY_CLASSES_ROOT\Folder\shell\].

另请参阅: Post by steve.marks59

XP treats "HKEY_CLASSES_ROOT\Directory\shell" and 
"HKEY_CLASSES_ROOT\Folder\shell" Registry keys and values differently.

Sub keys and values of "HKEY_CLASSES_ROOT\Directory\shell" are displayed 
in both the Windows Explorer Left Pane Folders context menu and 
Windows Explorer Right Pane Folders context menu.

Sub keys and values of "HKEY_CLASSES_ROOT\Folder\shell" are only displayed 
in the Windows Explorer Left Pane Folders context menu. These items are 
displayed at the top of the menu.

The order of the items displayed in the Windows Explorer Left Pane Folders 
context menu is:

HKEY_CLASSES_ROOT\Folder\shell
HKEY_CLASSES_ROOT\AllFilesystemObjects\shell
HKEY_CLASSES_ROOT\Directory\shell

The order of the items displayed in the Windows Explorer Right Pane Folders 
context menu is:

HKEY_CLASSES_ROOT\(Specific File ex. batfile)\shell
HKEY_CLASSES_ROOT\Directory\shell
HKEY_CLASSES_ROOT\AllFilesystemObjects\shell 

答案 1 :(得分:1)

答案很晚,但正确的选择是使用Folder,但要排除RecyleBin以及创建名为REG_SZ的{​​{1}}值并将其设置为AppliesTo所需的其他内容}。

答案 2 :(得分:0)

据我所知,您别无选择,只能使用文件夹。没有其他文件关联键不包含回收站。如果要选择显示菜单选项的文件夹类型,则必须编写资源管理器扩展名。

相关问题