InsertMenuItem function user32

Win32Result<bool> InsertMenuItem(
  1. HMENU hmenu,
  2. int item,
  3. bool fByPosition,
  4. Pointer<MENUITEMINFO> lpmi,
)

Inserts a new menu item at the specified position in a menu.

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

Implementation

Win32Result<bool> InsertMenuItem(
  HMENU hmenu,
  int item,
  bool fByPosition,
  Pointer<MENUITEMINFO> lpmi,
) {
  final result_ = InsertMenuItemW_Wrapper(
    hmenu,
    item,
    fByPosition ? TRUE : FALSE,
    lpmi,
  );
  return Win32Result(value: result_.value.i32 != FALSE, error: result_.error);
}