CreateWindow function user32

Win32Result<HWND> CreateWindow(
  1. PCWSTR? lpClassName,
  2. PCWSTR? lpWindowName,
  3. WINDOW_STYLE dwStyle,
  4. int X,
  5. int Y,
  6. int nWidth,
  7. int nHeight,
  8. HWND? hWndParent,
  9. HMENU? hMenu,
  10. HINSTANCE? hInstance,
  11. 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.

To use extended window styles in addition to the styles supported by CreateWindow, use the CreateWindowEx function.

To learn more, see learn.microsoft.com/windows/win32/api/winuser/nf-winuser-createwindoww.

Implementation

@pragma('vm:prefer-inline')
Win32Result<HWND> CreateWindow(
  PCWSTR? lpClassName,
  PCWSTR? lpWindowName,
  WINDOW_STYLE dwStyle,
  int X,
  int Y,
  int nWidth,
  int nHeight,
  HWND? hWndParent,
  HMENU? hMenu,
  HINSTANCE? hInstance,
  Pointer? lpParam,
) => CreateWindowEx(
  WS_EX_LEFT,
  lpClassName,
  lpWindowName,
  dwStyle,
  X,
  Y,
  nWidth,
  nHeight,
  hWndParent,
  hMenu,
  hInstance,
  lpParam,
);