PDA

View Full Version : Get Path of playing song?


Tsuyo
13th February 2010, 21:24
Hi, How do i get the Path of the Playing song? I mean something like : C:/music/bla.mp3

Greetings

DrO
13th February 2010, 21:54
//this gets the current song (ansi version)
char* file = (char*)SendMessage(hwnd_winamp,WM_WA_IPC,
SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GETLISTPOS),IPC_GETPLAYLISTFILE);
//or as a unicode version
wchar_t* file = (wchar_t*)SendMessage(hwnd_winamp,WM_WA_IPC,
SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GETLISTPOS),IPC_GETPLAYLISTFILEW);or you can just get it when IPC_PLAYING_FILE or IPC_PLAYING_FILEW is sent (see wa_ipc.h for how to get the notification).

-daz

Tsuyo
13th February 2010, 22:54
Hi, Thanks for your Answer.
I tried that:

LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
if(message == WM_WA_IPC && lParam == IPC_PLAYING_FILE)
{
// do what you need to do here, e.g.
HWND hWnd = FindWindow(NULL,L"G-Amp");
if (hWnd){
SendMessage(hWnd,WM_songpath,0,wParam);
}
}
return TRUE;
}


But, i get nothing :/

DrO
14th February 2010, 08:51
you can't send a pointer to a string between processes like that. you'd need to use something like a WM_COPYDATA message to transfer between Winamp and your app (as seems to be what you're trying to do - hadn't we already covered this in earlier posts?).

-daz

Tsuyo
14th February 2010, 15:14
Hm, i already fixed it. I used the wrong "Window"