CreateWindowEx function Null safety user32

int CreateWindowEx (
  1. int dwExStyle,
  2. Pointer<Utf16> lpClassName,
  3. Pointer<Utf16> lpWindowName,
  4. int dwStyle,
  5. int X,
  6. int Y,
  7. int nWidth,
  8. int nHeight,
  9. int hWndParent,
  10. int hMenu,
  11. int hInstance,
  12. Pointer<NativeType> lpParam
)

Creates an overlapped, pop-up, or child window. It specifies the window class, window title, window style, and (optionally) the initial position and size of the window. The function also specifies the window's parent or owner, if any, and the window's menu.

HWND CreateWindowExW(
  DWORD     dwExStyle,
  LPCWSTR   lpClassName,
  LPCWSTR   lpWindowName,
  DWORD     dwStyle,
  int       X,
  int       Y,
  int       nWidth,
  int       nHeight,
  HWND      hWndParent,
  HMENU     hMenu,
  HINSTANCE hInstance,
  LPVOID    lpParam
);

Implementation

int CreateWindowEx(
    int dwExStyle,
    Pointer<Utf16> lpClassName,
    Pointer<Utf16> lpWindowName,
    int dwStyle,
    int X,
    int Y,
    int nWidth,
    int nHeight,
    int hWndParent,
    int hMenu,
    int hInstance,
    Pointer lpParam) {
  final _CreateWindowEx = _user32.lookupFunction<
      IntPtr Function(
          Uint32 dwExStyle,
          Pointer<Utf16> lpClassName,
          Pointer<Utf16> lpWindowName,
          Uint32 dwStyle,
          Int32 X,
          Int32 Y,
          Int32 nWidth,
          Int32 nHeight,
          IntPtr hWndParent,
          IntPtr hMenu,
          IntPtr hInstance,
          Pointer lpParam),
      int Function(
          int dwExStyle,
          Pointer<Utf16> lpClassName,
          Pointer<Utf16> lpWindowName,
          int dwStyle,
          int X,
          int Y,
          int nWidth,
          int nHeight,
          int hWndParent,
          int hMenu,
          int hInstance,
          Pointer lpParam)>('CreateWindowExW');
  return _CreateWindowEx(dwExStyle, lpClassName, lpWindowName, dwStyle, X, Y,
      nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam);
}