I'm building two programs, a text editor and a zipper, but in this two programs I want to associate a file type to they, but how can I do this? Thanks.
2 Answers
You need to edit the registry: http://support.microsoft.com/kb/257592
You'll probably want to use regedit to see previous file associations, to make sure you don't mess up.

- 8,242
- 9
- 40
- 57
-
Remember that I'm developing for Windows Mobile. – Nathan Campos Nov 14 '09 at 13:31
-
Also, I need to change something in my application to automatic show the file content? – Nathan Campos Nov 14 '09 at 13:32
-
Sorry, I missed the windows mobile tag. I've never used windows mobile, but a bit after a bit of googling, it seems that it's still done by editing the registry, not sure it's in the same place or somewhere else though – Jeffrey Aylesworth Nov 18 '09 at 01:45
I know this is an old thread, but I don't think you should be messing around with the registry like that. Especially not since ClickOnce and other deployment wizards have implemented a built-in capability to make a file-association. You can find this in Solution Explorer -> Project Properties -> Publish tab -> Options button -> File-associations tab. Here you have the ability to register a file-type using a custom icon, description of the file, and a program identification.
If you want to take a step ahead, you can do this with Single-instance applications as well. I did this in a tutorial project on my website: DrawIt In the project I'm setting up a TCP-listener in the first instance and in the second, third, ... instance I connect a TCP-client and send the ActivationArguments to the first one.
The most important code blocks are in the file Program.cs and void Start_server in Hoofdscherm.cs.

- 43
- 9