SetDlgItemTextA function

Sets the title or text of a control in a dialog box.

Syntax

BOOL SetDlgItemTextA(
  HWND   hDlg,
  int    nIDDlgItem,
  LPCSTR lpString
);

Parameters

hDlg

Type: HWND

A handle to the dialog box that contains the control.

nIDDlgItem

Type: int

The control with a title or text to be set.

lpString

Type: LPCTSTR

The text to be copied to the control.

Return Value

Type: BOOL

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastError.

Remarks

The SetDlgItemText function sends a WM_SETTEXT message to the specified control.

Examples

For an example, see Using List Boxes.

Requirements

   
Windows version Windows 2000 Professional [desktop apps only] Windows 2000 Server [desktop apps only]
Target Platform Windows
Header winuser.h (include Windows.h)
Library User32.lib
DLL User32.dll

See Also

Conceptual

Dialog Boxes

GetDlgItemInt

GetDlgItemText

Reference

SetDlgItemInt

WM_SETTEXT