PDA

View Full Version : Ipc_get_playing_filename


francisco_cpg
13th October 2007, 00:35
I am trying to use IPC_GET_PLAYING_FILENAME in a external app with Winamp 5.35 as follows:

wchar_t * filename = (wchar_t*)SendMessage(hwnd_winamp, WM_USER, 0, IPC_GET_PLAYING_FILENAME);

but the result in filename is always L"";

if I use

int selcnt = SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_PLAYLIST_GET_SELECTED_COUNT);

it works just fine.
So my question is:
Why it´s not working the message IPC_GET_PLAYING_FILENAME?
Thanks!

DrO
13th October 2007, 00:44
it is because that api is designed only for inprocess and not interprocess usage (as you're trying to do - comes down to mapping issues between one process and another which doesn't work for buffers whereas plain number returns will work since there's no address space mappings needing to be done, etc). lookup 'winamp magic' on how to get around this limitation

-daz

francisco_cpg
15th October 2007, 01:55
ok, thanks for reply.
In fact i already use this to get File Name in the playlist (IPC_GETPLAYLISTFILE). So i have to apply the ReadProcessMemory trick to that message (IPC_GET_PLAYING_FILENAME) too!
thanks!