SetMenu function user32

Win32Result<bool> SetMenu(
  1. HWND hWnd,
  2. HMENU? hMenu
)

Assigns a new menu to the specified window.

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

Implementation

Win32Result<bool> SetMenu(HWND hWnd, HMENU? hMenu) {
  resolveGetLastError();
  final result_ = _SetMenu(hWnd, hMenu ?? nullptr);
  return .new(value: result_ != FALSE, error: GetLastError());
}