SetDlgItemText function user32

Win32Result<bool> SetDlgItemText(
  1. HWND hDlg,
  2. int nIDDlgItem,
  3. PCWSTR lpString
)

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

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

Implementation

Win32Result<bool> SetDlgItemText(HWND hDlg, int nIDDlgItem, PCWSTR lpString) {
  resolveGetLastError();
  final result_ = _SetDlgItemText(hDlg, nIDDlgItem, lpString);
  return .new(value: result_ != FALSE, error: GetLastError());
}