【问题标题】:Folder right click menu(Only Folder)文件夹右键菜单(仅文件夹)
【发布时间】:2009-10-08 13:26:24
【问题描述】:

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

【问题讨论】:

    标签: c# shell directory contextmenu


    【解决方案1】:

    确实迟到了答案,但正确的选择是使用Folder,但是要排除 RecyleBin 和其他需要创建名为 REG_SZ 的值 AppliesTo 并将其设置为 System.FileName:?* 的东西。

    【讨论】:

      【解决方案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 
      

      【讨论】:

        【解决方案3】:

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

        【讨论】:

        猜你喜欢
        • 2012-05-28
        • 2014-01-11
        • 1970-01-01
        • 2014-02-10
        • 1970-01-01
        • 2013-05-10
        • 1970-01-01
        • 1970-01-01
        • 2016-11-01
        相关资源
        最近更新 更多