You should check for command line parameters sent to you in the Sub Main.
Windows calls the associated application in the following way:
<Application.exe> %1 %2 %3 %4 %5 ....
here %1 etc. will be replaced with the File Names.
for e.g.
OpenFile.exe C:\Bharat\File1.txt c:\Bharat\File2.txt
In Sub Main parse the command line parameters and do what ever you wanna
do to them.
To get the parameters you can use Microsoft.VisualBasic.Command()
Functrion which Returns the argument portion of the command line used to
launch an executable program.
Example
This example uses the Command function to return the command-line
arguments in an object containing an array.
Function GetCommandLineArgs() As String()
' Declare variables.
Dim separators As String = " "
Dim commands As String = Microsoft.VisualBasic.Command()
Dim args() As String = commands.Split(separators.ToCharArray)
Return args
End Function
Augusto399 wrote:
I am developing an application which should enable its user to create a file.
Now, my application will be able to open that file to enable the user to edit
it, etc. Since long time ago, i've been trying to do this: go to windows
explorer and double click the file that was created and then.. the
application should magically open and load the file. I've been able to make
the application run when this happens (it's very simple) though i can't load
the file (because i don't know which file is it ). I'm sure that when
this happens, windows will send some kind of arguments or data to the
program. However, i cannot get this information and, thus, cannot open the
file when the user double clicks on it.
Help please!
--
Best,
_____________
Bharat Sharma
* TEN Technologies.
* Official Web: _www.ten-technologies.com_
<http://www.ten-technologies.comemail/>
Personal Web: _www.bharatsharma.net_ <http://www.bharatsharma.net/>