CreateMDIWindow function

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

Syntax


HWND WINAPI CreateMDIWindow(
  _In_      LPCTSTR lpClassName,
  _In_      LPCTSTR lpWindowName,
  _In_      DWORD dwStyle,
  _In_      int X,
  _In_      int Y,
  _In_      int nWidth,
  _In_      int nHeight,
  _In_opt_  HWND hWndParent,
  _In_opt_  HINSTANCE hInstance,
  _In_      LPARAM lParam
);

Parameters

lpClassName [in]

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 [in]

Type: LPCTSTR

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

dwStyle [in]

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.

ValueMeaning
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 [in]

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 [in]

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 [in]

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 [in]

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 [in, optional]

Type: HWND

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

hInstance [in, optional]

Type: HINSTANCE

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

lParam [in]

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]

Header

Winuser.h (include Windows.h)

Library

User32.lib

DLL

User32.dll

Unicode and ANSI names

CreateMDIWindowW (Unicode) and CreateMDIWindowA (ANSI)

See also

Reference
CreateWindow
RegisterClassEx
WM_MDICREATE
Conceptual
Multiple Document Interface

 

 

Community Additions

ADD
Show:
© 2014 Microsoft