Windows Live Messenger“我在听什么”功能 [英] Windows Live Messenger "What I'm listening to" function

查看:169
本文介绍了Windows Live Messenger“我在听什么”功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用Windows Live Messenger我在听什么功能?如何与WLM通信以发送歌曲信息,所以Messenger可以设置状态?我在C ++(Qt)中编码

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.

编辑:

看起来我没有说清楚。我不想要一个演练。我想知道是否有一个API,或库,或任何东西与Windows Live Messenger通信使用该功能,像媒体播放器,如WMP,Winamp和iTunes做。

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.

我搜索了Live Connect API,但我没有找到任何内容。

I searched the Live Connect API, but I haven't found anything about that.

推荐答案

开源项目实现这个功能,你可以检查(像MPC-HC,PsyMP3,Songbird ...),我会解释一下如何做:

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:

首先创建一个如下所示的Unicode字符串:

First you build a Unicode string looking like this:


Player\0Type \0Playing\0Format \0Artist\0Type\\ \\ 0Album\0GUID\0

Player\0Type\0Playing\0Format\0Artist\0Type\0Album\0GUID\0

(\ 0不是NUL,所以一定要转义它们)

(The \0's are NOT NUL, so make sure to escape them)


  • 播放器:您的音乐播放器的名称

  • 类型:媒体类型,播放:1播放,0为停止

  • 格式:正在播放旁边的字符串,例如: A3FPlayer: {1} - {0}

  • 艺术家,

  • Player: Name of your Music Player
  • Type: Type of media, here: "Music"
  • Playing: 1 for playing, 0 for stopped
  • Format: The string next to "Now Playing", e.g: A3FPlayer: {1} - {0}
  • Artist, Title & Album are self-explanatory
  • GUID: WMCONTENTID

然后,建立一个COPYDATASTRUCT,如下所示:

Then you build a COPYDATASTRUCT like this:

COPYDATASTRUCT data;
data.dwData = 0x0547; //1351 decimal
data.lpData = (PVOID)(LPCWSTR)MsnMsg;
data.cbData = MsnMsgSize * 2 + 2;

最后将该结构传递给 MsnMsgrUIManager 你将找到 FindWindowEx

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);

这篇关于Windows Live Messenger“我在听什么”功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆