MrPuzzled
4th May 2002, 08:32
Hi,
I'm wanting to tell Winamp to play a file/add a file to the playlist in Delphi. Has anyone got a reliable Procedure to do this?
I do have this, which came from a freeware component to control winamp:
procedure AddMp3ToPlayList(mp3ToAdd:string);
Var
x : integer;
begin
Mp3ToAdd:=MP3ToAdd+#0;
GethWnd_WinAmp;
for x:=0 to Length(MP3ToAdd) do
PostMessage(hwnd_winamp,wm_user,ord(mp3toadd[x]),IPC_PLAYFILE);
// also crashes if I comment the line below out
PostMessage(hwnd_winamp,wm_user,0,IPC_PLAYFILE);
end;
But this unfortunately works when adding the first time, for some weird reason it causes Winamp to crash with "This application performed an illegal operation", on tryiing to add a second file.
Thanks
I'm wanting to tell Winamp to play a file/add a file to the playlist in Delphi. Has anyone got a reliable Procedure to do this?
I do have this, which came from a freeware component to control winamp:
procedure AddMp3ToPlayList(mp3ToAdd:string);
Var
x : integer;
begin
Mp3ToAdd:=MP3ToAdd+#0;
GethWnd_WinAmp;
for x:=0 to Length(MP3ToAdd) do
PostMessage(hwnd_winamp,wm_user,ord(mp3toadd[x]),IPC_PLAYFILE);
// also crashes if I comment the line below out
PostMessage(hwnd_winamp,wm_user,0,IPC_PLAYFILE);
end;
But this unfortunately works when adding the first time, for some weird reason it causes Winamp to crash with "This application performed an illegal operation", on tryiing to add a second file.
Thanks