SetDlgItemInt function user32

Win32Result<bool> SetDlgItemInt(
  1. HWND hDlg,
  2. int nIDDlgItem,
  3. int uValue,
  4. bool bSigned,
)

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

To learn more, see learn.microsoft.com/windows/win32/api/winuser/nf-winuser-setdlgitemint.

Implementation

Win32Result<bool> SetDlgItemInt(
  HWND hDlg,
  int nIDDlgItem,
  int uValue,
  bool bSigned,
) {
  resolveGetLastError();
  final result_ = _SetDlgItemInt(
    hDlg,
    nIDDlgItem,
    uValue,
    bSigned ? TRUE : FALSE,
  );
  return .new(value: result_ != FALSE, error: GetLastError());
}