How do you create an application in VB 6 which is a default application for a specified file format?

create vb

What I mean, when you double click an mp3 file, it is automatically opened in Windows Media Player. I wanted to do that in VB 6. Pls help me….


Related Blogs


        Related Blogs

              Share and Enjoy:
              • Digg
              • Sphinn
              • del.icio.us
              • Facebook
              • Mixx
              • Google
              • LinkedIn
              • SphereIt
              • Wykop
              • Ping.fm
              • Furl
              • Reddit

              3 Responses to “How do you create an application in VB 6 which is a default application for a specified file format?”

              • agarwalmanoj says:

                a hint - you have to make a registry entry with yr VB application.

              • itmanoxford says:

                Good question!

                First, write your VB program.
                In your startup code (e.g. sub Main) you can refer to the commandline (which is where the name of the file will appear), e.g.
                Msgbox Command()
                (you’ll probably want to do something cleverer with the filename than just displaying it.)

                Compile the program e.g. Test.exe and save it e.g.
                C:\Temp\Test.exe

                Then set up a file association for the filetype you want to use:
                In Windows Explorer,
                Tools | Folder Options | File Types
                Click on New to enter a new filetype.
                Enter the filetype e.g. ZZZ and click OK.
                Then click Advanced, then New, to set up a new action for this filetype.
                In ‘Action’ type “open” (without the quotes)
                In ‘Application used…’ browse to C:\Temp\Test.exe
                Click OK - OK - Close.

                That’s it!

              • RajMirage says:

                You can write the app with whatever tool you want. Then you can asociate a file extension with your app using windows explorer menu item Tools/folder options.Go to the “File types” tab and associate the file extension .mp3 with your app.
                In your VB app, check for command line arguments. The full path of the file which was double clicked by the user will be the second argument.

              Leave a Reply

              Sponsored Links
              My Products