From a53aa543b4dbb51666dc65d8f2b3b64bf0a7fe69 Mon Sep 17 00:00:00 2001 From: James Tabor Date: Tue, 22 Sep 2015 00:38:48 +0000 Subject: [PATCH] [Win32SS] - Fix MDI menu redraw. Tested with WineFile. svn path=/trunk/; revision=69312 --- reactos/win32ss/user/ntuser/nonclient.c | 12 ++++++++++-- reactos/win32ss/user/ntuser/simplecall.c | 7 +++++++ reactos/win32ss/user/user32/windows/defwnd.c | 1 + reactos/win32ss/user/user32/windows/mdi.c | 3 +++ 4 files changed, 21 insertions(+), 2 deletions(-) diff --git a/reactos/win32ss/user/ntuser/nonclient.c b/reactos/win32ss/user/ntuser/nonclient.c index 6fa7dababfd..3c9aaa645de 100644 --- a/reactos/win32ss/user/ntuser/nonclient.c +++ b/reactos/win32ss/user/ntuser/nonclient.c @@ -988,6 +988,15 @@ VOID UserDrawCaptionBar( if (!(Style & WS_MINIMIZE)) { + PMENU menu = UserGetMenuObject(UlongToHandle(pWnd->IDMenu)); + /* Draw menu bar */ + if (menu && !(Style & WS_CHILD)) + { + TempRect = CurrentRect; + TempRect.bottom = TempRect.top + menu->cyMenu; + CurrentRect.top += MENU_DrawMenuBar(hDC, &TempRect, pWnd, FALSE); + } + if (ExStyle & WS_EX_CLIENTEDGE) { DrawEdge(hDC, &CurrentRect, EDGE_SUNKEN, BF_RECT | BF_ADJUST); @@ -1014,7 +1023,6 @@ NC_DoNCPaint(PWND pWnd, HDC hDC, INT Flags) PWND Parent; RECT WindowRect, CurrentRect, TempRect; BOOL Active = FALSE; - PCURICON_OBJECT pIcon = NULL; if (!IntIsWindowVisible(pWnd) || (pWnd->state & WNDS_NONCPAINT && !(pWnd->state & WNDS_FORCEMENUDRAW)) || @@ -1118,7 +1126,7 @@ NC_DoNCPaint(PWND pWnd, HDC hDC, INT Flags) CurrentRect.top += UserGetSystemMetrics(SM_CYCAPTION); } - UserDrawCaption(pWnd, hDC, &TempRect, NULL, pIcon ? UserHMGetHandle(pIcon) : NULL, NULL, Flags); + UserDrawCaption(pWnd, hDC, &TempRect, NULL, NULL, NULL, Flags); /* Draw buttons */ if (Style & WS_SYSMENU) diff --git a/reactos/win32ss/user/ntuser/simplecall.c b/reactos/win32ss/user/ntuser/simplecall.c index 57352a69f92..a447c4b2fa3 100644 --- a/reactos/win32ss/user/ntuser/simplecall.c +++ b/reactos/win32ss/user/ntuser/simplecall.c @@ -380,6 +380,13 @@ NtUserCallTwoParam( switch(Routine) { + case TWOPARAM_ROUTINE_REDRAWTITLE: + { + DWORD_PTR Ret; + Window = UserGetWindowObject((HWND)Param1); + Ret = (DWORD_PTR)UserPaintCaption(Window, (INT)Param2); + RETURN(Ret); + } case TWOPARAM_ROUTINE_SETMENUBARHEIGHT: { DWORD_PTR Ret; diff --git a/reactos/win32ss/user/user32/windows/defwnd.c b/reactos/win32ss/user/user32/windows/defwnd.c index 368043f2fa1..9b6e1bd4da4 100644 --- a/reactos/win32ss/user/user32/windows/defwnd.c +++ b/reactos/win32ss/user/user32/windows/defwnd.c @@ -382,6 +382,7 @@ UserPaintCaption(PWND pwnd, INT Flags) ReleaseDC(UserHMGetHandle(pwnd), hDC); } } + //NtUserCallTwoParam((DWORD_PTR)UserHMGetHandle(pwnd),Flags,TWOPARAM_ROUTINE_REDRAWTITLE) } LRESULT FASTCALL diff --git a/reactos/win32ss/user/user32/windows/mdi.c b/reactos/win32ss/user/user32/windows/mdi.c index 7fdfee0c734..b9e9470cc14 100644 --- a/reactos/win32ss/user/user32/windows/mdi.c +++ b/reactos/win32ss/user/user32/windows/mdi.c @@ -1092,8 +1092,11 @@ static void MDI_UpdateFrameText( HWND frame, HWND hClient, BOOL repaint, LPCWSTR DefWindowProcW( frame, WM_SETTEXT, 0, (LPARAM)lpBuffer ); if (repaint) + { + if (!NtUserCallTwoParam((DWORD_PTR)frame,DC_ACTIVE,TWOPARAM_ROUTINE_REDRAWTITLE)) SetWindowPos( frame, 0,0,0,0,0, SWP_FRAMECHANGED | SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE | SWP_NOZORDER ); + } }