How can I use the Windows Live Messenger "What I'm listening to" function? How can I communicate with the WLM to send the song info, so Messenger can set the status? I'm coding in C++ (Qt)
I searched all the net but found nothing about it, not even in other programming languages.
EDIT:
Looks like i didn't make myself clear. I don't want a walkthrough. I want to know if there is an API, or library, or anything to communicate with the Windows Live Messenger to use that function, like media players such as WMP, Winamp and iTunes do.
I searched the Live Connect API, but I haven't found anything about that.
As there are many open source projects implementing this feature which you could check up (like MPC-HC, PsyMP3, Songbird ... etc.), I'll just explain how it's done:
First you build a Unicode string looking like this:
Player\0Type\0Playing\0Format\0Artist\0Type\0Album\0GUID\0
(The \0's are NOT NUL, so make sure to escape them)
A3FPlayer: {1} - {0}
Then you build a COPYDATASTRUCT like this:
COPYDATASTRUCT data;
data.dwData = 0x0547; //1351 decimal
data.lpData = (PVOID)(LPCWSTR)MsnMsg;
data.cbData = MsnMsgSize * 2 + 2;
And finally pass that struct to the MsnMsgrUIManager
handle which you would find with FindWindowEx
:
HWND hWnd = FindWindowEx(NULL, NULL, L"MsnMsgrUIManager", NULL);
SendMessage(hWnd, WM_COPYDATA, (WPARAM)NULL, (LPARAM)&data);