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 ?
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.
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”.
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.
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].
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With