OK not the greatest title but this one is not too easy to put in a few words

i have a jpg file for example with a custom file extension of jjj for example
now i associate .jjj with my application so that when i click a .jjj file my application runs.
how do tell my application the filename and/or path of the .jjj file that opened it?

Recommended Answers

All 2 Replies

>open custom file and display it when file is click

Its called "Registered file types". Choose "Folder Option" of explorer tools menu to assign file extension to the application.

Was able to fine a way to do what i wanted the code in my app needed to be this

Dim args() As String = Environment.GetCommandLineArgs

        If args.Length > 1 Then
            args(0) = ""
            Dim fileName As String = String.Join(" ", args).Trim

            Dim fi As New System.IO.FileInfo(fileName)
            If fi.Exists AndAlso fi.Extension.ToUpper = ".JJJ" Then
                Debug.Print(fi.FullName)
            End If
        End If
    End Sub

in order for me to get the path and name of the file that started the app up

props where props are due this is not my code found it on experts-exchange written by Idle_Mind

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.