SetWindowLongPtr function user32

Win32Result<int> SetWindowLongPtr(
  1. HWND hWnd,
  2. WINDOW_LONG_PTR_INDEX nIndex,
  3. int dwNewLong
)

Changes an attribute of the specified window.

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

Implementation

Win32Result<int> SetWindowLongPtr(
  HWND hWnd,
  WINDOW_LONG_PTR_INDEX nIndex,
  int dwNewLong,
) {
  resolveGetLastError();
  final result_ = _SetWindowLongPtr(hWnd, nIndex, dwNewLong);
  return .new(value: result_, error: GetLastError());
}