CreateMDIWindowA function

Creates a multiple-document interface (MDI) child window.

Syntax

HWND CreateMDIWindowA(
  LPCSTR    lpClassName,
  LPCSTR    lpWindowName,
  DWORD     dwStyle,
  int       X,
  int       Y,
  int       nWidth,
  int       nHeight,
  HWND      hWndParent,
  HINSTANCE hInstance,
  LPARAM    lParam
);

Parameters

lpClassName

Type: LPCTSTR

The window class of the MDI child window. The class name must have been registered by a call to the RegisterClassEx function.

lpWindowName

Type: LPCTSTR

The window name. The system displays the name in the title bar of the child window.

dwStyle

Type: DWORD

The style of the MDI child window. If the MDI client window is created with the MDIS_ALLCHILDSTYLES window style, this parameter can be any combination of the window styles listed in the Window Styles page. Otherwise, this parameter is limited to one or more of the following values.

Value Meaning
WS_MINIMIZE
0x20000000L
Creates an MDI child window that is initially minimized.
WS_MAXIMIZE
0x01000000L
Creates an MDI child window that is initially maximized.
WS_HSCROLL
0x00100000L
Creates an MDI child window that has a horizontal scroll bar.
WS_VSCROLL
0x00200000L
Creates an MDI child window that has a vertical scroll bar.

X

Type: int

The initial horizontal position, in client coordinates, of the MDI child window. If this parameter is CW_USEDEFAULT ((int)0x80000000), the MDI child window is assigned the default horizontal position.

Y

Type: int

The initial vertical position, in client coordinates, of the MDI child window. If this parameter is CW_USEDEFAULT, the MDI child window is assigned the default vertical position.

nWidth

Type: int

The initial width, in device units, of the MDI child window. If this parameter is CW_USEDEFAULT, the MDI child window is assigned the default width.

nHeight

Type: int

The initial height, in device units, of the MDI child window. If this parameter is set to CW_USEDEFAULT, the MDI child window is assigned the default height.

hWndParent

Type: HWND

A handle to the MDI client window that will be the parent of the new MDI child window.

hInstance

Type: HINSTANCE

A handle to the instance of the application creating the MDI child window.

lParam

Type: LPARAM

An application-defined value.

Return Value

Type: Type: HWND

If the function succeeds, the return value is the handle to the created window.

If the function fails, the return value is NULL. To get extended error information, call GetLastError.

Requirements

   
Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header winuser.h (include Windows.h)
Library User32.lib
DLL User32.dll

See Also

Conceptual

CreateWindow

Multiple Document Interface

Reference

RegisterClassEx

WM_MDICREATE