windows_programming_notes.nbk: Home | Index | Next Page: GetEnvironmentStrings | Previous Page: GetDlgItemInt
The GetDlgItemText function retrieves the title or text associated with a control in a dialog box.
UINT GetDlgItemText( HWND hDlg, // handle to dialog box int nIDDlgItem, // control identifier LPTSTR lpString, // pointer to buffer for text int nMaxCount // maximum size of string );
If the function succeeds, the return value specifies the number of TCHARs copied to the buffer, not including the terminating null character.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
The GetDlgItemText function sends a WM_GETTEXT message to the control.
For the ANSI version of the function, the number of TCHARs is the number of bytes; for the Unicode version, it is the number of characters.
windows_programming_notes.nbk: Home | Index | Next Page: GetEnvironmentStrings | Previous Page: GetDlgItemInt
Notebook exported on Monday, 7 July 2008, 18:56:50 PM Eastern Daylight Time