我折腾了一个上午也没弄出来

解决方案 »

  1.   

    用sendmessage试试,发送wm_settext消息.
      

  2.   

    获得外部程序的句柄,用sendmessage发送消息
      

  3.   

    先得到外部指定程序的名柄,再得到其内的特定文本框的名柄,然后用SendMessage或PostMessage函数设置其内容.
      

  4.   

    对SetWindowText无效,因为它只能设置本程序的文本框
      

  5.   

    既然 MSDN里面有个However,SetWindowText不行了
    SetWindowText
    The SetWindowText function changes the text of the specified window's title bar (if it has one). If the specified window is a control, the text of the control is changed. However, SetWindowText cannot change the text of a control in another application.BOOL SetWindowText(
      HWND hWnd,         // handle to window or control
      LPCTSTR lpString   // title or text
    );而这里没有那么就是它了哦
    WM_SETTEXT
    An application sends a WM_SETTEXT message to set the text of a window.
      

  6.   

    用FINDWINDOW找出那个文本框的句柄。。再用SETWINDOWTEXT OR SENDMESSAGE,都可以。