但依靠微软其它很多接口暂时没有实现/提供
然后咧,高级点儿的方法是用“注射”或者hook方式,这里有篇很不错的文章详细介绍相关技术
<Three Ways to Inject Your Code into Another Process>
http://www.codeproject.com/useritems/winspy.asp (以前做过一个df1 修改器就是用lib inject方式,嘻嘻)
简单的方法楼上朋友说了,就是 FindWindow 或 EnumWindows 找到 Messenger 的对话窗口,对其 RichText 发送选择消息。
这个方法楼上有朋友说 codeproject 有例子,源代码和地址在这里(且让我慷他人之慨):
<Retrieving Conversations from MSN Messenger>
http://www.codeproject.com/cpp/msnchattext.asp?target=messenger
不过实话说,当时看到这篇文章时觉得这个方法并不是很好——多人同时聊还不太好处理,该作者还写了另外一篇对付 yahoo messenger 的文章。
呵呵,作者说了这么一句话:
This gives us the opportunity to make some fantastic SPYING applications that can email MSN conversations of someone to you or whatever you can think of!
你可以找到 DMsgrObjectEvents::OnTextReceived Event
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/messenger/reference/messengeruasdk/events/dmsgrobjectevents/OnTextReceived.asp
--------------------------------
Indicates that a message has been received.
Note The DMsgrObjectEvents::OnTextReceived event is available for use in Microsoft Windows Messenger 4.7. It might be altered or unavailable in subsequent versions of Windows Messenger.
pIMSession
[in] Pointer to an IMsgrIMSession interface.
pSourceUser
[in] Pointer to an IMsgrUser interface.
bstrMsgHeader
[in] BSTR that contains the header text.
bstrMsgText
[in] BSTR that contains the message text.
pfEnableDefault
[in, out] Pointer to a VARIANT_BOOL that indicates whether the default is enabled.
Return Value