xincale
26th June 2002, 10:45
I add a file(*.m3u) to WINAMP PLAYLIST with below code.
1¡¢Most of time,it work well when state of WINAMP be normal.but,the file dont be added to PlAYLIST sometimes
2¡¢the file alway dont be added to PlAYLIST when state of WINAMP be minimized.
Why? Can someone help me?
Thanks
Xincale 2002.06.26
Public Sub WinAMP_AddFileToPlayList(Filename As String)
'Adds a file to the playlist
'hWndWinamp is a property of this ClASS
If hWndWinamp = 0 Then 'can't find Winamp
Exit Sub
End If
Dim cds As COPYDATASTRUCT
cds.dwData = waAddFile
' = 100 (IPC_PLAYFILE)
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
' Reserve space for filename plus trailing null char
RetVal = CopyDataSendMessage(hWndWinamp, WM_COPYDATA, 0&, cds)
End Sub
1¡¢Most of time,it work well when state of WINAMP be normal.but,the file dont be added to PlAYLIST sometimes
2¡¢the file alway dont be added to PlAYLIST when state of WINAMP be minimized.
Why? Can someone help me?
Thanks
Xincale 2002.06.26
Public Sub WinAMP_AddFileToPlayList(Filename As String)
'Adds a file to the playlist
'hWndWinamp is a property of this ClASS
If hWndWinamp = 0 Then 'can't find Winamp
Exit Sub
End If
Dim cds As COPYDATASTRUCT
cds.dwData = waAddFile
' = 100 (IPC_PLAYFILE)
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
' Reserve space for filename plus trailing null char
RetVal = CopyDataSendMessage(hWndWinamp, WM_COPYDATA, 0&, cds)
End Sub