0
votes

In my C# game, I would like to make my application default for all ".htf" files. Right now that only opens up the application. Is there some kind of event I can use to get the path of the file opened?

1

1 Answers

1
votes

You need to create an installer for your application and then use File Type Editor (in MSI type setup project) to associate the particular extension to your app.

You can do the same with ClickOnce type installer too. Check this SO post for more information.

For full file path, Windows passes the file name as the first argument of the command line to your application. You can use Environment.GetCommandLineArgs() (C#/VB.NET) or My.Application.CommandLineArgs (VB.NET) to get the full path of the incoming file.