02-16-2009 06:04 AM
Hi,
I am trying to communicate with WinAmp (MP3 player) through the sendmessage function in User32.dll
So far I can send commands like play, stop, forward, play next etc. but sending a filename to play gives no result.
This is the structure of the command:
#define IPC_ENQUEUEFILE 100
/* This is sent as a WM_COPYDATA with IPC_PLAYFILE as the dwData member and the string
** of the file / playlist to be enqueued into the playlist editor as the lpData member.
** This will just enqueue the file or files since you can use this to enqueue a playlist.
** It will not clear the current playlist or change the playback state.
**
** COPYDATASTRUCT cds = {0};
** cds.dwData = IPC_ENQUEUEFILE;
** cds.lpData = (void*)"c:\\test\\folder\\test.mp3";
** cds.cbData = lstrlen((char*)cds.lpData)+1; // include space for null char
** SendMessage(hwnd_winamp,WM_COPYDATA,0,(LPARAM)&cds);
**
WM_COPYDATA = 0x4A
In the VI you can see what I did. Before running the VI WinAmp must be already started. The led "windowfound" should be on.
I tried several things but no luck so far.
Can someone help me out with this problem ?
Solved! Go to Solution.
02-16-2009 08:40 AM
02-16-2009 08:49 AM
Hallo Wiebe,
I didn't make a cluster, but I tried to format a string with the data.
But as I understand you I have to do something else.
Here are the VI's in 8.0 (I also forgot the sub vi and a control)
02-16-2009 10:10 AM
02-17-2009 03:06 AM
Wiebe, Thank you for your reply. It is not exactly clear to me (yet) but I will look into it and let you know.
Groeten, Kees
02-17-2009 04:10 AM
02-18-2009 02:16 AM
Hi Wiebe,
Took me some time, but I got it working. See attached files.
Again thank you very much
Kees
02-18-2009 08:10 AM
06-08-2010 12:13 AM
02-24-2020 08:03 PM - edited 02-24-2020 08:05 PM
Hi YKee,
I am interested in this topic. Do you have the sample code which is workable? I found the file "smlib_WM_main.zip 29 KB", but it cannot work correct for me. Receive side cannot receive the string. Anyway, thanks for your sample code.