可用函数CWnd::GetDlgItem(),假设你的文本框的ID为IDC_ASDF,则你可用GetDlgItem(IDC_
ASDF)获得本框的指针.
另外,你还可用CLASSWIZARD加一个文本框的变量.

解决方案 »

  1.   

    getDlgItem好象只能得到Label,和窗体的的句柄,对文本框似乎不起作用。
      

  2.   

    geldlgitem 的第二个参数是控件的id,怎么会对文本框不起作用呢
      

  3.   

    使用GetDltItem()使用有一个参数的那个!很好用的
      

  4.   

    CEdit *pEdit=(CEdit*)GetDlgItem(ID_TEST);
    HANDLE hEdit=pEdit->GetSafeHandle();
      

  5.   

    HWND FindWindowEx(
      HWND hwndParent,      // handle to parent window
      HWND hwndChildAfter,  // handle to child window
      LPCTSTR lpszClass,    // class name
      LPCTSTR lpszWindow    // window name
    );
      

  6.   

    void CWnd::GetDlgItem( int nID, HWND* phWnd ) const;Return ValueA pointer to the given control or child window. If no control with the integer ID given by the nID parameter exists, the value is NULL. The returned pointer may be temporary and should not be stored for later use.ParametersnIDSpecifies the identifier of the control or child window to be retrieved.phWndA pointer to a child window.