When you double-click on a Word document, Word is automatically run and the document is loaded.
What steps are needed to do the same thing with my C# application?
In other words, assume my application uses ‘.XYZ’ data files. I know how to tell Windows to start my application when a .XYZ data file is double clicked. But how do I find out within my application what data file was chosen so I can load it?
I did this in a project I was working on awhile ago and don’t have the source code handy, but I believe it really came down to this:
args is empty when the application is normally started, but when you’ve properly linked in the association to your .xyz file, when one of those files is selected, your application will be launched with the file location as the first element of the string[]. Certainly either in program.cs or your launch form, I would add validation, but at the base level I believe this is what you need to do.