I dont believe so, I have no hwnd to throw getparent. The mdi's dont have an actuall hwnd declared they have a client area created in which i send messages to create children.
My mdi Callback.
Code:
LRESULT CALLBACK MDIProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam) {
switch(Message) {
case WM_CREATE:
funcs.AddMDI(hwnd, LOWORD(wParam));
break;
case WM_SIZE:
funcs.SizeMDI(lParam, LOWORD(wParam));
break;
case WM_CLOSE:
break;
}
return DefMDIChildProc(hwnd, Message, wParam, lParam);
}
Creating New MDI window.
Code:
mcs.szTitle = text;
mcs.szClass = CCMClassName2;
mcs.hOwner = MainInst;
mcs.x = 1;
mcs.y = 1;
mcs.cx = 772;
mcs.cy = 490;
mcs.style = MDIS_ALLCHILDSTYLES;
SendMessage(mainCA, WM_MDICREATE, 0, (LONG)(LPMDICREATESTRUCT)&mcs)
Creating MDI ClientArea
Code:
CLIENTCREATESTRUCT ccs;
ccs.hWindowMenu = 0;
ccs.idFirstChild = MDISTARTID;
mainCA = CreateWindowEx(WS_EX_CLIENTEDGE, "MDICLIENT", (LPCTSTR) NULL, WS_CHILD | WS_CLIPSIBLINGS | WS_VISIBLE,
105, 20, 782, 500, hwnd, 0, funcs.MainInst, (LPSTR) &ccs);
Now if my mdi windows had a hwnd handle like mainCA does than I believe I would do something similar to what you said or even more simplistic, but without a stored hwnd how does the mdi know who it is?
Take note: All this code works perfectly mdi windows are created just fine I edited out a few things because of not related.