SetDlgItemInt function (winuser.h)

Sets the text of a control in a dialog box to the string representation of a specified integer value.

Syntax

BOOL SetDlgItemInt(
  [in] HWND hDlg,
  [in] int  nIDDlgItem,
  [in] UINT uValue,
  [in] BOOL bSigned
);

Parameters

[in] hDlg

Type: HWND

A handle to the dialog box that contains the control.

[in] nIDDlgItem

Type: int

The control to be changed.

[in] uValue

Type: UINT

The integer value used to generate the item text.

[in] bSigned

Type: BOOL

Indicates whether the uValue parameter is signed or unsigned. If this parameter is TRUE, uValue is signed. If this parameter is TRUE and uValue is less than zero, a minus sign is placed before the first digit in the string. If this parameter is FALSE, uValue is unsigned.

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

To set the new text, this function sends a WM_SETTEXT message to the specified control.

Requirements

Requirement Value
Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header winuser.h (include Windows.h)
Library User32.lib
DLL User32.dll
API set ext-ms-win-ntuser-dialogbox-l1-1-2 (introduced in Windows 10, version 10.0.10240)

See also

Conceptual

Dialog Boxes

GetDlgItemInt

Reference

SetDlgItemText

WM_SETTEXT