SetWindowDisplayAffinity function user32

Win32Result<bool> SetWindowDisplayAffinity(
  1. HWND hWnd,
  2. WINDOW_DISPLAY_AFFINITY dwAffinity
)

Stores the display affinity setting in kernel mode on the hWnd associated with the window.

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

Implementation

Win32Result<bool> SetWindowDisplayAffinity(
  HWND hWnd,
  WINDOW_DISPLAY_AFFINITY dwAffinity,
) {
  resolveGetLastError();
  final result_ = _SetWindowDisplayAffinity(hWnd, dwAffinity);
  return .new(value: result_ != FALSE, error: GetLastError());
}