开发者

Trying to extract an MDI child window outside its MDI parent

I have been able to reparent an mdichild window to the desktop with the following code:

SetParent(hSeekedWindow,0);
SetWindowLong(hSeekedWindow,GWL_STYLE,WS_OVERLAPPED|WS_VISIBLE|WS_CAPTION|WS_MAXIMIZE开发者_运维技巧BOX|    WS_MINIMIZEBOX|WS_THICKFRAME|WS_SIZEBOX);
SetWindowLong(hSeekedWindow,GWL_EXSTYLE,WS_EX_CLIENTEDGE);

However, as soon as i try to resize the ex-childwindow the whole app crashes. I suppose this is because the exchild is not getting its messages anymore. My question is this: would i be able to make this work if i somehow created an invisible mdichild that forwards its messages to exchild?


Yeah, that's not healthy. Do it the same way as Windows Forms does it, just re-create the window, now minus the WS_EX_MDICHILD style flag. Destroy the old one. Yes, you'll get a bit of flicker. Leverage your existing code simply by giving this new window the same window procedure.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜