0 out of 1 rated this helpful - Rate this topic

CreateMDIWindow function

Applies to: desktop apps only

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

Minimum supported server

Windows 2000 Server

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

 

 

Send comments about this topic to Microsoft

Build date: 2/3/2012

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ