本帖最后由 adslhack 于 2010-12-29 10:23:10 编辑

解决方案 »

  1.   

    成员变量初始化
    m_EditBox1=_T("11111");
      

  2.   

    控件初始值咯。要么setwindowtext
      

  3.   

    SendMessage(HWND_EDIT, WM_SETTEXT, 0, (LPARAM)_T("Hello,World"));
      

  4.   

    TX的这个窗口应该是用DX画的吧,通过API是得不到的了,想别的办法!
      

  5.   

    他是ATL的,可以得到,先得到查找联系人/企业/群这个窗口的句柄,再枚举其子窗口得到EDIT,然后再发SETWINDOWTEXT等办法往里面写值
      

  6.   


    void CRTSTestDlg::OnBnClickedButton6()
    {
    HWND hwnd = ::FindWindow("TXGuiFoundation","查找联系人/群/企业");
    if(hwnd)
    {
    hwnd = GetChildWindow(hwnd,2);
    if (hwnd)
    {
    int ii = 0;
    ::PostMessage(hwnd,WM_PASTE,0,0);
    }
    }}/************************************************************************/
    HWND CRTSTestDlg::GetChildWindow(HWND hwnd,int iIndex)
    {
    HWND hwndChind = NULL;
    CString strTemp = "";
    int i = 1;
    hwndChind = ::GetWindow(hwnd,GW_CHILD);
    CWnd *pWnd = CWnd::FromHandle(hwndChind);
    while (pWnd)
    {
    hwndChind = pWnd->GetSafeHwnd();
    if (i == iIndex)
    {
    return hwndChind;
    }
    pWnd = pWnd->GetNextWindow(GW_HWNDNEXT);
    i++;
    }
    return hwndChind;
    }这段代码能将你剪贴板中的内容填写到你要的目标窗口中
      

  7.   


    --------------------Configuration: RTSTest - Win32 Debug--------------------
    Compiling resources...
    Compiling...
    StdAfx.cpp
    Compiling...
    RTSTest.cpp
    RTSTestDlg.cpp
    D:\RTSTest\RTSTestDlg.cpp(174) : error C2039: 'GetChildWindow' : is not a member of 'CRTSTestDlg'
            d:\rtstest\rtstestdlg.h(14) : see declaration of 'CRTSTestDlg'
    Generating Code...
    Error executing cl.exe.RTSTest.exe - 1 error(s), 0 warning(s)
    提于这个,哥哥
      

  8.   

    注释一个 // Enable3dControls();就可以运行了,但是“TXGuiFoundation”并没有添加到群号框里去,我换成“1234567”也不行。为什么呢??
      

  9.   


    --------------------Configuration: RTSTest - Win32 Debug--------------------
    Compiling resources...
    Compiling...
    StdAfx.cpp
    Compiling...
    RTSTest.cpp
    RTSTestDlg.cpp
    D:\RTSTest\RTSTestDlg.cpp(174) : error C2039: 'GetChildWindow' : is not a member of 'CRTSTestDlg'
      d:\rtstest\rtstestdlg.h(14) : see declaration of 'CRTSTestDlg'
    Generating Code...
    Error executing cl.exe.RTSTest.exe - 1 error(s), 0 warning(s)GetChildWindow这个函数是我自己定义的一个函数,你需要按照成员函数的正常定义流程来做啊,这里体现的是没有在头文件中添加声明。
      

  10.   


    #include "stdafx.h"
    #include <windowS.h>
    HWND GetChildWindow(HWND hwnd,int iIndex)
    {
    HWND hwndChind = NULL;
    int i = 1;
    hwndChind = ::GetWindow(hwnd,GW_CHILD);
    while (hwndChind)
    {    
    if (i == iIndex)
    {
    return hwndChind;
    }
    hwndChind = ::GetNextWindow(hwndChind,GW_HWNDNEXT);
    i++;
    }
    return hwndChind;
    }
    int _tmain(int argc, _TCHAR* argv[])
    {
    HWND hwnd = ::FindWindow("TXGuiFoundation","查找联系人/群/企业");
    if(hwnd)
    {
    hwnd = GetChildWindow(hwnd,2);
    if (hwnd)
    {
    int ii = 0;
    ::PostMessage(hwnd,WM_PASTE,0,0);//发送此消息前将你要填写的内容写入到剪帖板
    }
    }
    getchar();
    return 0;
    }一个控制台程序,再不行就帮不到你了
      

  11.   

    或者:::SendMessage(hwnd,WM_SETTEXT,0,(LPARAM)"aa你好啊aaa");