Double click file - open in my app

  • Thread starter Thread starter ElmoWatson
  • Start date Start date
E

ElmoWatson

I set the association for a partcular filetype, to my application. Now,
though, when I double click on a file of that filetype, it will open my
application, but the file will not automatically load in it.

How can I set my program so that, when I double click on a file, the file
will load automatically in my application?
 
I set the association for a partcular filetype, to my application. Now,
though, when I double click on a file of that filetype, it will open my
application, but the file will not automatically load in it.

How can I set my program so that, when I double click on a file, the file
will load automatically in my application?

When you double click the file, Windows will start your app and pass
the name of the file on the command line. You will have to get the
filename from the command line and open it inside your program.

If your program has a main subroutine, then you can get the command
line arguments from main. Or you can use Environment.CommandLine.

Chris
 
Back
Top