InsertMenuItem function Null safety user32

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

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

BOOL InsertMenuItemW(
  HMENU            hmenu,
  UINT             item,
  BOOL             fByPosition,
  LPCMENUITEMINFOW lpmi
);

Implementation

int InsertMenuItem(
    int hmenu, int item, int fByPosition, Pointer<MENUITEMINFO> lpmi) {
  final _InsertMenuItem = _user32.lookupFunction<
      Int32 Function(IntPtr hmenu, Uint32 item, Int32 fByPosition,
          Pointer<MENUITEMINFO> lpmi),
      int Function(int hmenu, int item, int fByPosition,
          Pointer<MENUITEMINFO> lpmi)>('InsertMenuItemW');
  return _InsertMenuItem(hmenu, item, fByPosition, lpmi);
}