Register file extension with custom exe

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have an exe console app that i wrote, which works on custom data files. I'd like to give these data files a custom extension and somehow register that file extension with my exe, so all i have to do is double click the data file and my exe will launch.

How do you register an exe with a file extension

Once this is done, and you double click the file with the file extension, how does the exe know which file was clicked? is the path passed into the exe as one of the args in the Main function

Thanks
 
I have an exe console app that i wrote, which works on custom data files.
I'd like to give these data files a custom extension and somehow register
that file extension with my exe, so all i have to do is double click the
data file and my exe will launch.

How do you register an exe with a file extension?

Once this is done, and you double click the file with the file extension,
how does the exe know which file was clicked? is the path passed into the
exe as one of the args in the Main function?

Thanks
Hi,

Indeed, the location of that file gets passed as one of the args in the
Main function.
Usually such kind of associations are done by the installation script.
Also, the user can associate a specific file type with an application. Of
course, you can implement the code to associate the file type by yourself:

For the begining I would suggest you to associate that file type manually,
by using the Explorer. This way you could inspect the parameters which get
passed to your application and the registry keys.

You can read more about the file associations here:
http://msdn.microsoft.com/library/en-us/shellcc/platform/shell/programmersgu
ide/shell_basics/shell_basics_extending/fileassociations/fileassoc.asp


Regards,
Adrian Vinca [MSFT], Developer Division
--------------------------------------------------------------------
This reply is provided "AS IS", without warranty (express or implied).

Note: For the benefit of the community-at-large, all responses to this
message are best directed to the newsgroup/thread from which they
originated.
 
Back
Top