From 4f7abc05c2ab8dfcfd7d878774b0fd7ac3ec27f3 Mon Sep 17 00:00:00 2001 From: Rein Klazes Date: Sat, 31 Oct 1998 12:18:17 +0000 Subject: [PATCH] MDIchild created when the MDI client has the MDIS_ALLCHILDSTYLES style, should not be shown at creation nor activated unless the WS_VISIBLE flag is set. --- windows/mdi.c | 37 ++++++++++++++++++++++++++----------- 1 file changed, 26 insertions(+), 11 deletions(-) diff --git a/windows/mdi.c b/windows/mdi.c index a618f7e9832..022d6b4029a 100644 --- a/windows/mdi.c +++ b/windows/mdi.c @@ -356,18 +356,33 @@ static HWND32 MDICreateChild( WND *w, MDICLIENTINFO *ci, HWND32 parent, ShowWindow32( hwnd, SW_SHOWMINNOACTIVE ); else { - SetWindowPos32( hwnd, 0, 0, 0, 0, 0, SWP_SHOWWINDOW | SWP_NOSIZE | SWP_NOMOVE ); + /* WS_VISIBLE is clear if a) the MDI client has + * MDIS_ALLCHILDSTYLES style and 2) the flag is cleared in the + * MDICreateStruct. If so the created window is not shown nor + * activated. + */ + int showflag=wnd->dwStyle & WS_VISIBLE; + /* clear visible flag, otherwise SetWindoPos32 ignores + * the SWP_SHOWWINDOW command. + */ + wnd->dwStyle &= ~WS_VISIBLE; + if(showflag){ + SetWindowPos32( hwnd, 0, 0, 0, 0, 0, SWP_SHOWWINDOW | SWP_NOSIZE | SWP_NOMOVE ); + + /* Set maximized state here in case hwnd didn't receive WM_SIZE + * during CreateWindow - bad! + */ + + if((wnd->dwStyle & WS_MAXIMIZE) && !ci->hwndChildMaximized ) + { + ci->hwndChildMaximized = wnd->hwndSelf; + MDI_AugmentFrameMenu( ci, w->parent, hwnd ); + MDI_UpdateFrameText( w->parent, ci->self, MDI_REPAINTFRAME, NULL ); + } + }else + /* needed, harmless ? */ + SetWindowPos32( hwnd, 0, 0, 0, 0, 0, SWP_NOACTIVATE | SWP_NOSIZE | SWP_NOMOVE ); - /* Set maximized state here in case hwnd didn't receive WM_SIZE - * during CreateWindow - bad! - */ - - if((wnd->dwStyle & WS_MAXIMIZE) && !ci->hwndChildMaximized ) - { - ci->hwndChildMaximized = wnd->hwndSelf; - MDI_AugmentFrameMenu( ci, w->parent, hwnd ); - MDI_UpdateFrameText( w->parent, ci->self, MDI_REPAINTFRAME, NULL ); - } } TRACE(mdi, "created child - %04x\n",hwnd); } -- 2.11.4.GIT