Author: jimtabor Date: Sat Dec 8 01:56:58 2007 New Revision: 31065
URL: http://svn.reactos.org/svn/reactos?rev=31065&view=rev Log: Move WS_EX_MDICHILD check back in win32k. Reordered CreateWindowEx menu sets. All based on wine logic. Should SetMenu first or System menu? Tested with FF and AbiWord.
Modified: trunk/reactos/dll/win32/user32/windows/window.c trunk/reactos/subsystems/win32/win32k/ntuser/window.c
Modified: trunk/reactos/dll/win32/user32/windows/window.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/windows/wi... ============================================================================== --- trunk/reactos/dll/win32/user32/windows/window.c (original) +++ trunk/reactos/dll/win32/user32/windows/window.c Sat Dec 8 01:56:58 2007 @@ -354,13 +354,6 @@ hInstance, lpParam, FALSE); - - if ((dwStyle & WS_VISIBLE) && (dwExStyle & WS_EX_MDICHILD) && hwnd != (HWND)0) - { - SendMessageW(hWndParent, WM_MDIREFRESHMENU, 0, 0); - SetWindowPos(hwnd, HWND_TOP, 0, 0, 0, 0, SWP_SHOWWINDOW | SWP_NOMOVE | SWP_NOSIZE); - } - return hwnd; }
@@ -466,13 +459,6 @@ hInstance, lpParam, TRUE); - - if ((dwStyle & WS_VISIBLE) && (dwExStyle & WS_EX_MDICHILD) && hwnd != (HWND)0) - { - SendMessageW(hWndParent, WM_MDIREFRESHMENU, 0, 0); - SetWindowPos(hwnd, HWND_TOP, 0, 0, 0, 0, SWP_SHOWWINDOW | SWP_NOMOVE | SWP_NOSIZE); - } - return hwnd; }
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/window.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ntu... ============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/window.c (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/window.c Sat Dec 8 01:56:58 2007 @@ -1657,18 +1657,6 @@ Wnd->Instance = hInstance; Window->hSelf = hWnd;
- if (!hMenu) - hMenu = Wnd->Class->hMenu; - - if (0 != (dwStyle & WS_CHILD)) - { - Wnd->IDMenu = (UINT) hMenu; - } - else - { - IntSetMenu(Window, hMenu, &MenuChanged); - } - Window->MessageQueue = PsGetCurrentThreadWin32Thread()->MessageQueue; IntReferenceMessageQueue(Window->MessageQueue); Window->Parent = ParentWindow; @@ -1770,8 +1758,7 @@ }
/* create system menu */ - if((dwStyle & WS_SYSMENU) && - (dwStyle & WS_CAPTION) == WS_CAPTION) + if((dwStyle & WS_SYSMENU) )//&& (dwStyle & WS_CAPTION) == WS_CAPTION) { SystemMenu = IntGetSystemMenu(Window, TRUE, TRUE); if(SystemMenu) @@ -1780,6 +1767,20 @@ IntReleaseMenuObject(SystemMenu); } } + + /* Set the window menu */ + if ((dwStyle & (WS_CHILD | WS_POPUP)) != WS_CHILD) + { + if (hMenu) + IntSetMenu(Window, hMenu, &MenuChanged); + else + { + hMenu = Wnd->Class->hMenu; + if (hMenu) IntSetMenu(Window, hMenu, &MenuChanged); + } + } + else + Wnd->IDMenu = (UINT) hMenu;
/* Insert the window into the thread's window list. */ InsertTailList (&PsGetCurrentThreadWin32Thread()->WindowListHead, &Window->ThreadListEntry); @@ -2051,7 +2052,6 @@ RETURN((HWND)0); }
- /* Send move and size messages. */ if (!(Window->Flags & WINDOWOBJECT_NEED_SIZE)) { @@ -2064,7 +2064,6 @@ { DPRINT("Sending bogus WM_SIZE\n"); } -
lParam = MAKE_LONG(Window->Wnd->ClientRect.right - Window->Wnd->ClientRect.left, @@ -2073,7 +2072,6 @@ co_IntSendMessage(Window->hSelf, WM_SIZE, SIZE_RESTORED, lParam);
- DPRINT("IntCreateWindow(): About to send WM_MOVE\n");
if (0 != (Wnd->Style & WS_CHILD) && ParentWindow) @@ -2087,14 +2085,10 @@ Wnd->ClientRect.top); }
- co_IntSendMessage(Window->hSelf, WM_MOVE, 0, lParam); -
/* Call WNDOBJ change procs */ IntEngWindowChanged(Window, WOC_RGN_CLIENT); - - }
/* Show or maybe minimize or maximize the window. */ @@ -2105,11 +2099,13 @@
SwFlag = (Wnd->Style & WS_MINIMIZE) ? SW_MINIMIZE : SW_MAXIMIZE; + co_WinPosMinMaximize(Window, SwFlag, &NewPos); - SwFlag = - ((Wnd->Style & WS_CHILD) || UserGetActiveWindow()) ? - SWP_NOACTIVATE | SWP_NOZORDER | SWP_FRAMECHANGED : - SWP_NOZORDER | SWP_FRAMECHANGED; + + SwFlag = ((Wnd->Style & WS_CHILD) || UserGetActiveWindow()) ? + SWP_NOACTIVATE | SWP_NOZORDER | SWP_FRAMECHANGED : + SWP_NOZORDER | SWP_FRAMECHANGED; + DPRINT("IntCreateWindow(): About to minimize/maximize\n"); DPRINT("%d,%d %dx%d\n", NewPos.left, NewPos.top, NewPos.right, NewPos.bottom); co_WinPosSetWindowPos(Window, 0, NewPos.left, NewPos.top, @@ -2149,8 +2145,20 @@
if (dwStyle & WS_VISIBLE) { + if (Wnd->Style & WS_MAXIMIZE) + dwShowMode = SW_SHOW; + else if (Wnd->Style & WS_MINIMIZE) + dwShowMode = SW_SHOWMINIMIZED; + DPRINT("IntCreateWindow(): About to show window\n"); co_WinPosShowWindow(Window, dwShowMode); + + if (Wnd->ExStyle & WS_EX_MDICHILD) + { + co_IntSendMessage(ParentWindow->hSelf, WM_MDIREFRESHMENU, 0, 0); + /* ShowWindow won't activate child windows */ + co_WinPosSetWindowPos(Window, HWND_TOP, 0, 0, 0, 0, SWP_SHOWWINDOW | SWP_NOMOVE | SWP_NOSIZE); + } }
DPRINT("IntCreateWindow(): = %X\n", hWnd);