Click here to Skip to main content
15,919,028 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
I create my own advance Notepad.
and it's working fine and I enjoy too...
But on the last time it opened, as default but now when I try to make default program by :

Right click (txt file) → Open with → choose default program → ok.

I know this is not the right way,
Right way is to edit the registry.

So anyone can tell me what code should I use o edit those registry (extension registry)

By this i get with more question:

1st Question: I am using Advance Installer, they offer me to registry something that,
so I want to add the checkbox as make default program. and if so registry get edit...

If he/she forget to check or mistaken he/she uncheck and so I offer them a button on the Tab "more"so that if click that button then My program will become the default program,
Posted
Comments
Sergey Alexandrovich Kryukov 27-Dec-13 11:26am    
No, you did not create Notepad. Notepad was created by Microsoft. You probably created something else, which cannot be called "Notepad".
Have you heard the term "text editor"? :-)
Not only this registry structure is explained everywhere, but it's easy to find out by example, just by looking at existing registry.
So, what have you tried so far?
—SA
Modi Deep 28-Dec-13 7:05am    
ok,
yeah I know notepad is created by microsoft.
I don't create the notepad.
and th second thing: I said "advance notepad" yeah it includes notepad but it different.
Notepad ++ also having the name similar as "Notepad" it not mean that.
I create the simple some advance looking text editor and simply name as advance notepad.
Sergey Alexandrovich Kryukov 28-Dec-13 17:45pm    
Similar does not mean the same; the name Notepad++ emphasizes the fact it is intended to replace Notepad.
—SA

1 solution

Please see my comment to the question. Everything is explained here: http://msdn.microsoft.com/en-us/library/windows/desktop/cc144148%28v=vs.85%29.aspx[^].

[EDIT]

To update the registry, you can use this class: http://msdn.microsoft.com/en-us/library/microsoft.win32.registry%28v=vs.110%29.aspx[^].

—SA
 
Share this answer
 
v2
Comments
Modi Deep 28-Dec-13 7:09am    
can you show me with the example.
that solution make me some confused.

If possible show me example with TXT file extension.
reason: that has been already register with the Microsoft notepad,
ut I want to renew it with my program so what can I do for it?

Thank you
Sergey Alexandrovich Kryukov 28-Dec-13 17:51pm    
Please see the update to the answer, after [EDIT]. There is nothing else you need to know, so it should be easy; there are some code samples on this MSDN page. Yes, you can check up if "...\notepad.exe" is prescribed in the existing entries already and simply replace it with your path. However, it may or may not be appropriate for deployment. What if the user already replaced it with some other product? Then you would need to ask the user for the option (confirmation) for replacement of the TXT file type registration. It depends on what you need...
—SA

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