WM_MDICREATE
wParam = 0; /* not used, must be zero */
lParam = (LPARAM) (MDICREATESTRUCT FAR*) lpmcs; /* structure address */
An application sends the WM_MDICREATE message to a multiple document interface (MDI) client window to create a child window.
lpmcs
Value of lParam. Points to an MDICREATESTRUCT structure. The MDICREATESTRUCT structure has the following form:
typedef struct tagMDICREATESTRUCT { /* mdic */
LPCSTR szClass;
LPCSTR szTitle;
HINSTANCE hOwner;
int x;
int y;
int cx;
int cy;
DWORD style;
LPARAM lParam;
} MDICREATESTRUCT;
The return value is the handle of the new window in the low-order word and zero in the high-order word.
The window is created with the style bits WS_CHILD, WS_CLIPSIBLINGS, WS_CLIPCHILDREN, WS_SYSMENU, WS_CAPTION, WS_THICKFRAME, WS_MINIMIZEBOX, and WS_MAXIMIZEBOX, plus additional style bits specified in the MDICREATESTRUCT structure to which lpmcs points.
Windows adds the title of the new child window to the window menu of the frame window. An application should create all child windows of the client window with this message.
If the MDIS_ALLCHILDSTYLES style is set when the MDI client window is created, CreateWindow overrides the default style bits.
If a client window receives any message that changes the activation of child windows while the currently active MDI child window is maximized, Windows restores the currently active child window and maximizes the newly activated child window.
When the MDI child window is created, Windows sends the WM_CREATE message to the window. The lpmcs parameter of the WM_CREATE message contains a pointer to a CREATESTRUCT structure. The lpCreateParams member of the CREATESTRUCT structure contains a pointer to the MDICREATESTRUCT structure passed with the WM_MDICREATE message that created the MDI child window.
An application should not send a second WM_MDICREATE message while a WM_MDICREATE message is still being processed. For example, it should not send a WM_MDICREATE message while an MDI child window is processing its WM_CREATE message.