CWnd::GetWindowText
Visual Studio 2010
Copies the CWnd caption title (if it has one) into the buffer pointed to by lpszStringBuf or into the destination string rString.
int GetWindowText( LPTSTR lpszStringBuf, int nMaxCount ) const; void GetWindowText( CString& rString ) const;
If the CWnd object is a control, the GetWindowText member function copies the text within the control instead of copying the caption.
This member function causes the WM_GETTEXT message to be sent to the CWnd object.
See the example for CWnd::SetWindowText.