[Win32SS]
authorJames Tabor <james.tabor@reactos.org>
Tue, 22 Sep 2015 00:38:48 +0000 (00:38 +0000)
committerJames Tabor <james.tabor@reactos.org>
Tue, 22 Sep 2015 00:38:48 +0000 (00:38 +0000)
- Fix MDI menu redraw. Tested with WineFile.

svn path=/trunk/; revision=69312

reactos/win32ss/user/ntuser/nonclient.c
reactos/win32ss/user/ntuser/simplecall.c
reactos/win32ss/user/user32/windows/defwnd.c
reactos/win32ss/user/user32/windows/mdi.c

index 6fa7dab..3c9aaa6 100644 (file)
@@ -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)
index 57352a6..a447c4b 100644 (file)
@@ -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;
index 368043f..9b6e1bd 100644 (file)
@@ -382,6 +382,7 @@ UserPaintCaption(PWND pwnd, INT Flags)
         ReleaseDC(UserHMGetHandle(pwnd), hDC);
     }
   }
+  //NtUserCallTwoParam((DWORD_PTR)UserHMGetHandle(pwnd),Flags,TWOPARAM_ROUTINE_REDRAWTITLE)
 }
 
 LRESULT FASTCALL
index 7fdfee0..b9e9470 100644 (file)
@@ -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 );
+    }
 }