Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

adding my program to right-click menu

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 ?

like image 241
Foresp Avatar asked May 30 '11 18:05

Foresp


People also ask

How do you add a program to right click context menu?

Adding Applications to the Desktop Context MenuRight-click on the “shell” key, and then choose New > Key from the menu. Give the new key the name that you want to show up on the desktop context menu.

How do I add programs to the right-click menu in Windows 10?

Right click an empty space and go to “New” from the options. Here you have the option to add a program, a new folder or a shortcut to an app or a folder. You can add an option to send a file to a specific contact. Select “Contact”, add the contact and enter the details and then click “Ok”.

How do you add apps to right click?

Right-click the Shell key, and from the context menu, select New>Key. Give this key the same name as the app that you want to add to the context menu.


1 Answers

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].

like image 150
Jan-Peter Vos Avatar answered Oct 13 '22 11:10

Jan-Peter Vos