简体   繁体   English

如何在Windows资源管理器工具栏中创建自定义按钮

[英]How to create a custom button in Windows Explorer toolbar

I would like to know what is the process to add a custom button to the windows explorer bar programmatically? 我想知道以编程方式将自定义按钮添加到Windows资源管理器栏的过程是什么? It is different in Windows 7 and 8? 它在Windows 7和8中有所不同吗?

Is it possible to do it in C#? 是否有可能在C#中做到这一点? Or the best way is C++? 或者最好的方法是C ++?

Thanks! 谢谢!

在此输入图像描述

The buttons are set in the Windows registry, under HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FolderTypes\\GUID\\TasksItemsSelected and HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FolderTypes\\GUID\\TasksNoItemsSelected 这些按钮在Windows注册表中设置,位于HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FolderTypes\\GUID\\TasksItemsSelectedHKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FolderTypes\\GUID\\TasksNoItemsSelected

Use a type of REG_SZ , and the data is a ; 使用一种REG_SZ ,数据是a ; separated list of shell command names. 分隔的shell命令名列表。

The folder GUID s I know are: 我知道的文件夹GUID是:

  • 5c4f28b5-f869-4e84-8e60-f11db97c5cc7 -> General 5c4f28b5-f869-4e84-8e60-f11db97c5cc7 - >常规
  • 5fa96407-7e77-483c-ac93-691d05850de8 -> Videos 5fa96407-7e77-483c-ac93-691d05850de8 - >视频
  • 7d49d726-3c21-4f05-99aa-fdc2c9474656 -> Documents 7d49d726-3c21-4f05-99aa-fdc2c9474656 - >文件
  • 94d6ddcc-4a68-4175-a374-bd584a510b78 -> Music 94d6ddcc-4a68-4175-a374-bd584a510b78 - >音乐
  • b3690e58-e961-423b-b687-386ebfd83239 -> Pictures b3690e58-e961-423b-b687-386ebfd83239 - >图片
  • 5f4eab9a-6833-4f61-899d-31cf46979d49 -> Other libraries 5f4eab9a-6833-4f61-899d-31cf46979d49 - >其他库

The tasks you can pick are from the registry key: HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\CommandStore\\shell 您可以从注册表项中选择的任务: HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\CommandStore\\shell

You can add plain executables to this list by using the command subkey, and put the exe command in the data field. 您可以使用command子键将纯可执行文件添加到此列表中,并将exe命令放在数据字段中。 Have a look around for examples. 看看周围的例子。

Happy hunting. 快乐狩猎。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM