Double click file - open in my app

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?
 
C

Chris Dunaway

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top