指针为Windows资源管理器写入上下文菜单项 [英] Pointers for writing context menu items for windows explorer

查看:704
本文介绍了指针为Windows资源管理器写入上下文菜单项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是一个通用的问题。使用C#编写上下文菜单项的Windows资源管理器的指针?

This is a generic question. Any Pointers for writing context menu items for windows explorer using C#?

感谢和问候,
斯里兰卡

Thanks and regards, Sri

推荐答案

如果你想实现简单的东西,比如增加一个项目与启动一个.net应用程序的图标,你可以试试这个:

If you are trying to achieve something simple, like adding an item with an icon that launches a .NET app, you can try this:

看看Windows注册表。在 HKEY_CLASSES_ROOT 你会发现所有的文件扩展名。如果您选择的关键之一,你会看到扩展的标准名称。搜索一个节点下 HKEY_CLASSES_ROOT 这个名字,你会看到这个键结构:

Take a look at the Windows registry. Under HKEY_CLASSES_ROOT you'll find all the file extensions. If you select one of those keys you will see the standard name of the extension. Search for a node under HKEY_CLASSES_ROOT with that name and you'll see this key structure:

CLSID
DefaultIcon
Shell
  Edit
    Command
  Open
    Command
ShellEx

壳牌在每个节点是指一个上下文菜单项。
表示这些节点(像编辑或打开)的缺省值是在菜单上显示的文本。
为命令默认值告诉你哪些应用程式启动。例如: NOTEPAD.EXE%1 (其中,%1是文件URL的占位符)。
进行的DefaultIcon的缺省值是图标的网址(如有)

Each node under Shell refers to a context menu item. The default value for these nodes (like Edit or Open) is the text shown in the menu. The default value for Command tells you which app to launch. Example: notepad.exe %1 (where %1 is a placeholder for the file url). The default value for DefaultIcon is the url of the icon, if any.

看看本文中的示例:的添加上下文菜单的Windows资源管理器

Take a look at this article for an example: Add a context menu to the Windows Explorer

这篇关于指针为Windows资源管理器写入上下文菜单项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆