Hi, I tried to use that command with VisualBasic and I had an error message too :?
Probably I really lack of programming knowledge if I'm not able to make it work that way if I don't use C++...
This is the WORKING routine that I use with VB, I hope you'll find it useful (lines starting with
' are comments):
Code:
Public Sub BSPOpenFile(FileName As String)
Dim cds As COPYDATASTRUCT
'Find BSplayer window's handle
bsp_hand = FindWindow("BSPlayer", 0&)
'If BSplayer is running -> window found
If bsp_hand <> 0 Then
'Set OpenFile as action
cds.dwData = BSP_OpenFile
'Create and set the pointer to the file name string
'(VB doesn't provide pointers like C does)
cds.lpData = lstrcpy(FileName, FileName)
'Set the string lenght
cds.cbData = Len(FileName) + 1
'Open the selected file
ReturnCode = SendMessage(bsp_hand, WM_COPYDATA, 0&, cds)
End If
End Sub
EDIT:
Almost forgot, if you use WM_BSP_CMD instead of WM_COPYDATA in the send message call BSplayer knows that you are sending a command and not a copydatastruct