SendMessage function Null safety user32

int SendMessage(
  1. int hWnd,
  2. int Msg,
  3. int wParam,
  4. int lParam
)

Sends the specified message to a window or windows. The SendMessage function calls the window procedure for the specified window and does not return until the window procedure has processed the message.

LRESULT SendMessageW(
  HWND   hWnd,
  UINT   Msg,
  WPARAM wParam,
  LPARAM lParam
);

Implementation

int SendMessage(int hWnd, int Msg, int wParam, int lParam) {
  final _SendMessage = _user32.lookupFunction<
      IntPtr Function(IntPtr hWnd, Uint32 Msg, IntPtr wParam, IntPtr lParam),
      int Function(int hWnd, int Msg, int wParam, int lParam)>('SendMessageW');
  return _SendMessage(hWnd, Msg, wParam, lParam);
}