在Windows资源管理器中添加上下文菜单项 [英] Add a context menu item in Windows Explorer

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

问题描述

我在下面的链接中使用了代码
http://www.codeproject.com/KB/cs/appendmenu.aspx?fid=171288&select=3329164&tid=3329164

但是我需要将菜单链接到我的应用程序,即,应在单击该菜单的同时打开我的应用程序.

I used the code in the below link
http://www.codeproject.com/KB/cs/appendmenu.aspx?fid=171288&select=3329164&tid=3329164

But I need to link the menu with my application, i.e, my application should be opened while clicking that menu.

推荐答案

您需要将注册表项值设置为打开应用程序的命令.

您显然需要知道应用程序的安装路径,然后在注册表项上设置的命令应类似于"c:\ program files \ myApp \ mystuff.exe".

(只需不对"c:\ program files"位进行硬编码,请确保从实际的应用程序安装位置进行拾取.)
You need to set the registry key value to be the command that opens your application.

You obviously need to know the installation path of your app, and then the command you would set on the registry key would be something like "c:\program files\myApp\mystuff.exe".

(Just don''t hard code the "c:\program files" bit, make sure you pick it up from your actual apps installation location.)



使用C#& Windows Shell菜单上的文件夹概念 [ ^ ]

我刚刚使用HKCR \ Folder \ shell \并添加了一个菜单(您可以看到图像).

我刚刚在命令中将%1与可执行文件一起传递了.

现在,从我的应用程序中,我可以在参数列表中获取文件路径.

下载源代码并检查我的工作方式.

干杯.
:rose:
See how I did this in
Folder protection for windows using C# & Concepts on Windows Shell menu for Folders[^]

I have just used HKCR\Folder\shell\ and added one menu(you can see the image).

I have just passed %1 with the executable in the Command.

Now from my application I can get the file path in the Argument List.

download the Source and inspect how I did.

Cheers.
:rose:


不可能. :((

实际上,上下文菜单是应用于CLASS ID的,而不是基于实际文件夹的.

因此,如果应用此选项,它将影响所有文件夹,甚至会影响将来要创建的文件夹.
No it is not possible. :((

Actually context menu is applied to a CLASS ID, not based on actual folder.

So if you apply this, it will affect all folders even the folders you will be creating in future.


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

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