Link to home
Start Free TrialLog in
Avatar of donb1
donb1

asked on

Start application from vb5

I have been using the following code to open applications from vb5.  It works on most applications and in particular a version of music match written in VB.  Their latest version was written in C++ and it won't open with this code.  I can double click on a file.m3u and it will open.  How do I need to change the code to be able to open any application within vb5?

Private Sub List3_Click()
Dim musicfil As String
musicfil = List3.Text & ".m3u"
Dim lngRetVal As Long
ShellExecute Me.hwnd, "Open", musicfil, 0&, 0&, 5
End Sub
Avatar of tward
tward

Does it give you an error?  Does it simply not run the program?

It looks like you are running a file that is associated with this executable but maybe the association is not there any longer..?
It doesn't matter what the application that you are trying to launch was written in. So long as the association to that file type is made in Windows, ShellExecute will launch the appropriate EXE. If this has worked in the past and is not now, I would check that under File Types in Windows it actually specifies the application under OPEN.

Avatar of donb1

ASKER

The association is there, otherwise it would not open when I click on the file.m3u icon.  Question is, is my code correct?
Are you passing the FULL filename (with path)?
ASKER CERTIFIED SOLUTION
Avatar of Juilette
Juilette

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of donb1

ASKER

Thanks
That drag and drop is interesting but more complex than I need now.
The drag and drop is just a feature which can be taken out without a problem. What's important is how the code takes your file extension, looks up the registry to find out what the correct action is for this extension, and then executes it.