Click here to Skip to main content
15,917,709 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,

i have created a notepad application called MyNotePad.

when i right click on a .txt file it is showing options like Open, Print, Edit, etc..


Now i want one more option like 'Open with MyNotePad' when i right click on a txt file.
i want the default application to open txt file as default notepad, but when the user selects option 'Open with MyNotePad' it should be opened with MyNotepad.

Can anyone suggest me how to do this?

Thanks and Regards,
Sanju
Posted

You have to enter some keys in the registry. For a description see http://daycounter.com/LabBook/Changing-File-Associations-With-Registry-Editor.phtml[^]
 
Share this answer
 
Comments
Sanju Sanju 13-Mar-12 8:19am    
Thanks Bernhard Hiller.
This is wat i need. :)

But i have one more issue. Wen i select multiple files it is opening multiple instances. My requirement is it should open only one application and it should send all selected file paths as command line arguments to the application
Hi,

here's a good example how to achieve this manually.
You just have to do it programmatically, but it isn't a problem to insert this values to registry with c#.

http://thecustomizewindows.com/2011/01/how-to-add-any-program-shortcut-to-windows-7-right-click-context-menu/[^]

With Best Regards
 
Share this answer
 
Comments
Sanju Sanju 13-Mar-12 8:12am    
Thank you very much Björn Ranft.

It is very nice article. but the functionality is working when we right click on a directory. my requirement is, it should add a right click item only when i click a .txt file.

Any further help is very much appreciated
El_Codero 13-Mar-12 8:21am    
Ah ok! Then you've tried Bernhard Hiller's solution already?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900