[user32]
authorGiannis Adamopoulos <gadamopoulos@reactos.org>
Wed, 19 Oct 2011 19:21:59 +0000 (19:21 +0000)
committerGiannis Adamopoulos <gadamopoulos@reactos.org>
Wed, 19 Oct 2011 19:21:59 +0000 (19:21 +0000)
- When themes are active and the text of a window changes, we should send the WM_NCUAHDRAWCAPTION message instead of drawing the window directly ( which will result painting a classic caption on the themed window)
- Fixes explorer window that is repainted with a classic style when a subfolder is opened

svn path=/trunk/; revision=54201

reactos/dll/win32/user32/windows/defwnd.c
reactos/dll/win32/uxtheme/nonclient.c

index 5b6ccda..280aeff 100644 (file)
@@ -1984,7 +1984,15 @@ RealDefWindowProcA(HWND hWnd,
 
             if ((GetWindowLongPtrW(hWnd, GWL_STYLE) & WS_CAPTION) == WS_CAPTION)
             {
-                DefWndNCPaint(hWnd, HRGN_WINDOW, -1);
+                /* FIXME: this is not 100% correct */
+                if(gpsi->dwSRVIFlags & SRVINFO_APIHOOK)
+                {
+                    SendMessage(hWnd, WM_NCUAHDRAWCAPTION,0,0);
+                }
+                else
+                {
+                    DefWndNCPaint(hWnd, HRGN_WINDOW, -1);
+                }
             }
             Result = 1;
             break;
@@ -2130,7 +2138,15 @@ RealDefWindowProcW(HWND hWnd,
 
             if ((GetWindowLongPtrW(hWnd, GWL_STYLE) & WS_CAPTION) == WS_CAPTION)
             {
-                DefWndNCPaint(hWnd, HRGN_WINDOW, -1);
+                /* FIXME: this is not 100% correct */
+                if(gpsi->dwSRVIFlags & SRVINFO_APIHOOK)
+                {
+                    SendMessage(hWnd, WM_NCUAHDRAWCAPTION,0,0);
+                }
+                else
+                {
+                    DefWndNCPaint(hWnd, HRGN_WINDOW, -1);
+                }
             }
             Result = 1;
             break;
index c13e310..88dc7db 100644 (file)
@@ -1024,6 +1024,8 @@ ThemeWndProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam, WNDPROC DefWndPr
     {
     case WM_NCPAINT:
         return ThemeHandleNCPaint(hWnd, (HRGN)wParam);
+    case WM_NCUAHDRAWCAPTION:
+    case WM_NCUAHDRAWFRAME:
     case WM_NCACTIVATE:
         ThemeHandleNCPaint(hWnd, (HRGN)1);
         return TRUE;
@@ -1065,16 +1067,13 @@ ThemeWndProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam, WNDPROC DefWndPr
             Pt.x = (short)LOWORD(lParam);
             Pt.y = (short)HIWORD(lParam);
             NC_TrackScrollBar(hWnd, wParam, Pt);
+            return 0;
         }
         else
         {
             return DefWndProc(hWnd, Msg, wParam, lParam);
         }
     }
-    case WM_NCUAHDRAWCAPTION:
-    case WM_NCUAHDRAWFRAME:
-        /* FIXME: how should these be handled? */
-        return 0;
     default:
         return DefWndProc(hWnd, Msg, wParam, lParam);
     }