GetDlgItemText

This function retrieves the title or text associated with a control in a dialog box.

UINT GetDlgItemText( 
HWND hDlg, 
int nIDDlgItem, 
LPTSTR lpString, 
int nMaxCount); 

Parameters

  • hDlg
    [in] Handle to the dialog box that contains the control.
  • nIDDlgItem
    [in] Specifies the identifier of the control whose title or text is to be retrieved.
  • lpString
    [out] Long pointer to the buffer to receive the title or text.
  • nMaxCount
    [in] Specifies the maximum length, in characters, of the string to be copied to the buffer pointed to by lpString. If the length of the string exceeds the limit, the string is truncated.

Return Values

The number of characters copied to the buffer, not including the terminating null character, indicates success. Zero indicates failure. To get extended error information, call GetLastError.

Remarks

The GetDlgItemText function sends a WM_GETTEXT message to the control.

Requirements

Runs on Versions Defined in Include Link to
Windows CE OS 1.0 and later Winuser.h   Dlgmgr.lib

Note   This API is part of the complete Windows CE OS package as provided by Microsoft. The functionality of a particular platform is determined by the original equipment manufacturer (OEM) and some devices may not support this API.

See Also

GetDlgItemInt, GetLastError, SetDlgItemInt, SetDlgItemText, WM_GETTEXT

 Last updated on Tuesday, July 13, 2004

© 1992-2000 Microsoft Corporation. All rights reserved.