InsertMenu function Null safety user32

int InsertMenu (
  1. int hMenu,
  2. int uPosition,
  3. int uFlags,
  4. int uIDNewItem,
  5. Pointer<Utf16> lpNewItem
)

Inserts a new menu item into a menu, moving other items down the menu.

BOOL InsertMenuW(
  HMENU    hMenu,
  UINT     uPosition,
  UINT     uFlags,
  UINT_PTR uIDNewItem,
  LPCWSTR  lpNewItem
);

Implementation

int InsertMenu(int hMenu, int uPosition, int uFlags, int uIDNewItem,
    Pointer<Utf16> lpNewItem) {
  final _InsertMenu = _user32.lookupFunction<
      Int32 Function(IntPtr hMenu, Uint32 uPosition, Uint32 uFlags,
          IntPtr uIDNewItem, Pointer<Utf16> lpNewItem),
      int Function(int hMenu, int uPosition, int uFlags, int uIDNewItem,
          Pointer<Utf16> lpNewItem)>('InsertMenuW');
  return _InsertMenu(hMenu, uPosition, uFlags, uIDNewItem, lpNewItem);
}