Routine to open file as requested:
Public Sub BSPAddFile(filename As String)
' Adds a file to the playlist
hWndBSPlayer = FindWindow(bspClass, 0)
If hWndBSPlayer = 0 Then 'can't find BSPlayer
Exit Sub
End If
Dim cds As COPYDATASTRUCT
cds.dwData = BSP_OpenFile
cds.lpData = lstrcpy(filename, filename)
' Copies filename to itself. Nothing happens,
' but returns the address for the pointer to the string!
cds.cbData = Len(filename) + 1
RetVal = CopyDataSendMessage(hWndBSPlayer, WM_COPYDATA, 0&, cds)
End Sub
|