Do you have the ".gif" file association already set up? If not, see Associating file extensions with a program
Once you have that part done, you should have something in the registry like this:
HKEY_CURRENT_USER\Software\Classes\yourcorpname.yourappname.v1\shell\open\command", null, @"c:\path\to\app.exe \"%1\""
When the file is opened the %1
is replaced with the path of the file. You just need to make a Main
method that has parameters:
Sub Main(ByVal cmdArgs() As String)
MsgBox("The Main procedure is starting the application.")
Dim returnValue As Integer = 0
' See if there are any arguments.
If cmdArgs.Length > 0 Then
Dim pathToGifFile As String = cmdArgs(0)
' Now you have the path to the picture to add to the PictureBox
End If
' Insert call to appropriate starting place in your code.
MsgBox("The application is terminating.")
End Sub