
How do i get my program to open a file when I click on a file
The only way you can "open" file directly in your program
is if the windows explorer shell passes the name of that
file to your program.
There are 2 things you should do ...
1. Modify the association so that the name of the selected
file is also passed. In Windows Explorer, goto
Tools|Folder Options and select the 'File Types' tab.
Select your file extension and click the 'Advanced'
button. Select the edit option for the open action. In
the 'Application used to perform action' box, you would
find the path to your application ... just put a "%1"
(with the quotes) at the end of it.
2. Modify your program to handle command line parameters
(if you havent done so already). The name of the selected
file would be passed as a command-line parameter which you
can get at by using the Command$ function in vb.
Hope this helps
Subuki
Quote:
>-----Original Message-----
>How do i get my program to open a file when I click on a
>file. I've associated the file type with my program but
>when I double click on a file it just opens up my program
>but doesn't "open" the file...how can I get the filename
>of the file that I double clicked on?
>Best Regards,
>Alfie
>.