SetFocus function user32

Win32Result<HWND> SetFocus(
  1. HWND? hWnd
)

Sets the keyboard focus to the specified window.

The window must be attached to the calling thread's message queue.

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

Implementation

Win32Result<HWND> SetFocus(HWND? hWnd) {
  final result_ = SetFocus_Wrapper(hWnd ?? nullptr);
  return .new(value: .new(result_.value.ptr), error: result_.error);
}