04-26-2012, 09:22 AM
Bald Mountain Survivor
* Expert *
Join Date: Aug 2003
Location: Oregon, USA
I am somewhat out of my depth here as I have had zero interest in playing media from my apps, However...
If you double click one of your mp3 files manually does the correct player load?
If so then you could use the Shell() command or the API Execute command to launch your program with the selected file path and name.
Note: Any path or filename that contains a space must be bracketed by the double quote character.
Shell Execute Example:
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" _
(ByVal hwnd As Long, _
ByVal lpOperation As String, _
ByVal lpFile As String, _
ByVal lpParameters As String, _
ByVal lpDirectory As String, _
ByVal nShowCmd As Long) As Long
Const SW_SHOWNORMAL = 1
Private Sub Button1_Click()
Dim sFile as string
sFile = "C:\Documents and Settings\My Documents\My Music\Cool Tunes.mpg"
sFile = Chr(34) & sFile & Chr(34)
ShellExecute Me.hwnd, vbNullString, sFile, vbNullString, "C:\", SW_SHOWNORMAL
If your "Addin" is for your IE browser you might look into the WebBrowser Control.
Burn the land and boil the sea
You can't take the sky from me
Last edited by Gruff; 04-26-2012 at 09:48 AM.