SetDlgItemInt function

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

Syntax

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

Parameters

hDlg

Type: HWND

A handle to the dialog box that contains the control.

nIDDlgItem

Type: int

The control to be changed.

uValue

Type: UINT

The integer value used to generate the item text.

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

   
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

See Also

Conceptual

Dialog Boxes

GetDlgItemInt

Reference

SetDlgItemText

WM_SETTEXT