PeekMessage function Null safety user32

int PeekMessage (
  1. Pointer<MSG> lpMsg,
  2. int hWnd,
  3. int wMsgFilterMin,
  4. int wMsgFilterMax,
  5. int wRemoveMsg
)

Dispatches incoming sent messages, checks the thread message queue for a posted message, and retrieves the message (if any exist).

BOOL PeekMessageW(
  LPMSG lpMsg,
  HWND  hWnd,
  UINT  wMsgFilterMin,
  UINT  wMsgFilterMax,
  UINT  wRemoveMsg
);

Implementation

int PeekMessage(Pointer<MSG> lpMsg, int hWnd, int wMsgFilterMin,
    int wMsgFilterMax, int wRemoveMsg) {
  final _PeekMessage = _user32.lookupFunction<
      Int32 Function(Pointer<MSG> lpMsg, IntPtr hWnd, Uint32 wMsgFilterMin,
          Uint32 wMsgFilterMax, Uint32 wRemoveMsg),
      int Function(Pointer<MSG> lpMsg, int hWnd, int wMsgFilterMin,
          int wMsgFilterMax, int wRemoveMsg)>('PeekMessageW');
  return _PeekMessage(lpMsg, hWnd, wMsgFilterMin, wMsgFilterMax, wRemoveMsg);
}