将我的程序添加到右键菜单 [英] adding my program to right-click menu

查看:64
本文介绍了将我的程序添加到右键菜单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用右键菜单,我的意思是:我真的不知道它叫什么,但是我希望它的右键菜单.

当我用Google搜索类似该问题的标题的查询时,我什么也没得到.一些教程显示了如何将.exe添加到该列表等.但是我正在寻找一些教程,该教程将教我如何处理该数据,该右键单击菜单将返回我什么,等等.但是可悲的是,我发现没有什么.所以我在这里,问...

如何将我的程序添加到该列表中,当我执行返回给我的程序时,互联网上是否有任何有关此内容的教程?

解决方案

您将向注册表添加一些项,以使您的程序位于该列表中.您可以在此处找到有关此文件的更多信息:,否则,全名将被拆分为args [i]

with right click menu, I mean this: I dont really know what its called, but i hope its right click menu.

When I google for queries like title of this question, i get nothing. some tutorials that shows how can i add an .exe to that list etc. but I'm looking for some tutorial that will teach me how to handle that data, what that right click menu will return me, etc. But sadly, I found nothing. So here I am, asking...

How can I add my program to that list, and when I do what it returns to me, are there any tutorial for this on the internet ?

解决方案

You would add some keys to the registry to have your program in that list. You can find more about it here: http://www.howtogeek.com/howto/windows-vista/add-open-with-notepad-to-the-context-menu-for-all-files/

In the example they use Notepad.exe %1 that will basicly do the same as calling Notepad.exe c:\myFile.txt from the run window.

You can read the parameter in the main(string[] args) method. It will pass it as contents of the args parameter. You can also get that value anywhere else in your application using the Environment.GetCommandLineArgs() method.

Please note that you should use Notepad.exe "%1" if the file you right-click on has spaces in its fullname, otherwise the fullname will be split into the args[i].

这篇关于将我的程序添加到右键菜单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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