GetDlgItemText

2.x

  int GetDlgItemText(hwndDlg, idControl, lpsz, cbMax)    
  HWND hwndDlg; /* handle of dialog box */
  int idControl; /* identifier of control */
  LPSTR lpsz; /* address of buffer for text */
  int cbMax; /* maximum size of string */

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

Parameters

hwndDlg

Identifies the dialog box that contains the control.

idControl

Specifies the identifier of the control whose title is to be retrieved.

lpsz

Points to a buffer that is to receive the control's title or text.

cbMax

Specifies the maximum length, in bytes, of the string to be copied to the buffer pointed to by the lpsz parameter. The string is truncated if it is longer.

Return Value

The return value specifies the number of bytes copied to the buffer, not including the terminating null character, if the function is successful. Otherwise, it is zero.

Comments

The GetDlgItemText function sends a WM_GETTEXT message to the control.

See Also

GetDlgCtrlID, GetDlgItem, GetDlgItemInt