![]() |
#1 |
Junior Member
Join Date: Jun 2002
Posts: 3
|
Can someone help me? Please!!
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 |
![]() |
![]() |
![]() |
#2 |
Senior Member
Join Date: Feb 2002
Location: The backside of the universe on the trailing edge of eternity
Posts: 238
|
*works on it* but, I dunno, I cant recreate your problem, I have no problem adding to the playlist, whether winamp is minimized or not, and it always works
![]() |
![]() |
![]() |
![]() |
#3 |
Junior Member
Join Date: Jun 2002
Posts: 3
|
Problem be solve
modify the code: Change "cds.cbData = Len(Filename) + 1" to "cds.cbData = LenB(Filename) + 1" Now,it work well. Mey be,the reason is about coding of system, double byte? |
![]() |
![]() |
![]() |
#4 |
Senior Member
Join Date: Feb 2002
Location: The backside of the universe on the trailing edge of eternity
Posts: 238
|
could be that your file system is coming in as unicode, yeah
|
![]() |
![]() |
![]() |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|