1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
| CLIENTCREATESTRUCT ccs;
// Create MDI Client
RECT rect;
GetClientRect(hWnd, // handle to window
&Rect // client coordinates
);
// Find window menu where children will be listed
ccs.hWindowMenu = GetSubMenu(GetMenu(hwnd), 2);
ccs.idFirstChild = ID_MDI_FIRSTCHILD;
g_hMDIClient = CreateWindowEx(
WS_EX_CLIENTEDGE,
"mdiclient",
NULL,
WS_CHILD | WS_CLIPCHILDREN | WS_VSCROLL | WS_HSCROLL | WS_VISIBLE,
rect.right/2,
rect.top,
rect.right,
rect.bottom,
hwnd,
(HMENU)IDC_MAIN_MDI,
GetModuleHandle(NULL),
(LPVOID)&ccs);
if(g_hMDIClient == NULL)
MessageBox(hwnd, "Could not create MDI client.", "Error", MB_OK | MB_ICONERROR); |
Partager