就是Msn中聊天内容那个框中的所有文本,如何抓下来?

解决方案 »

  1.   

    你看看以下代码!自己改一下就ok了void __fastcall TForm1::FormCreate(TObject *Sender)
    {
    HWND hCurWindow,HC,HE;//定义三个窗口句柄变量,hCurWindow用于存放QQ用户登陆窗口的句柄,HC、HE分别存放号码框和密码框的句柄。
    if((hCurWindow= FindWindow(NULL,"QQ用户登录"))!=0||(hCurWindow=FindWindow(NULL,"OICQ用户登录"))!=0)
    {//很明显,调用FindWindow()函数去获得QQ登陆窗口的句柄
    String str;
    str.sprintf("0x%x",hCurWindow);
    }
    TCHAR wClassName[255];//类名变量
    HC=GetWindow(hCurWindow, GW_CHILD);//得到号码框的句柄
    HE=GetWindow(HC, GW_HWNDNEXT);//接着得到密码框的句柄
    GetClassName(HE, wClassName, sizeof(wClassName));//得到类名
    GetClassName(HC, wClassName, sizeof(wClassName));//得到类名
    EnableWindow(HE,false);//使窗口失效
    EnableWindow(HC,false);//使窗口失效
    }
      

  2.   

    codeproject.com 有个例子
    或者短消息 留下email
    我发给你
      

  3.   

    MSN 提供了三种接口,其中一个就是可以获得别人发送过来的聊天信息。
    我觉得不用hook什么的就能实现。
      

  4.   

    用FindWindow找到聊天框的句柄,再GetWindowText得到其文本
    不过这方法不一定可行,我也想知道piggybank(吞硬币的小猪)  所说的三个接口是什么
      

  5.   

    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/messenger/overview/sessioninvite.asp
      

  6.   

    我用了GetWindow,但聊天对话框的窗口类比较特殊,其内部的子窗口类型是 DirectUIHWND,
    不能得到输入控件与聊天内容控件的句柄.
      

  7.   

    微软有msn的sdk的,你去微软看看么。很详细的,具体的code就不贴了~
      

  8.   

    sorry 昨天下午 CSDN 几乎提交不了
    今天早上给楼主回消息也提交失败,sigh累死啦<Windows Messenger Application Programming Interfaces Downloads>
    这里是 MSDN Messenger 的主页 
    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/messenger/messenger_entry.asp
    它下面的
    <Windows Messenger Client Reference >
    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/messenger/reference/messengeruasdk/cpp_client_entry.asp你可以找到 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.Syntaxvoid OnTextReceived(          IMsgrIMSession *pIMSession,
        IMsgrUser *pSourceUser,
        BSTR bstrMsgHeader,
        BSTR bstrMsgText,
        VARIANT_BOOL *pfEnableDefault
    );
    ParameterspIMSession
    [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 ValueNo return value. 
    --------------------------------
      

  9.   

    但依靠微软其它很多接口暂时没有实现/提供
    然后咧,高级点儿的方法是用“注射”或者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!不知道楼主的目的为何?
      

  10.   

    to  newkey007(无限天空) :
    这个例子只能在Msn6.0以下工作,6.0就不有正常工作了.
    因为6.0聊天对话框类是DirectUIHWND,用GetWindow等窗口函数无法再进一步获取其下的
    Edit控件句柄.
      

  11.   

    我最近也在参与开发msn的bot,msn 6.0的api全部关闭了。可能用钩子是唯一的办法,但是国外的msn plus好像已经能够找到使用msn 6.0 api开发的办法。