[COMCTL32] -Fix drawing the borders of themed controls. Patch by Sylvain Deverre...
authorGiannis Adamopoulos <gadamopoulos@reactos.org>
Mon, 13 Feb 2017 15:08:47 +0000 (15:08 +0000)
committerGiannis Adamopoulos <gadamopoulos@reactos.org>
Mon, 13 Feb 2017 15:08:47 +0000 (15:08 +0000)
svn path=/trunk/; revision=73789

reactos/dll/win32/comctl32/listview.c
reactos/dll/win32/comctl32/theme_edit.c
reactos/dll/win32/comctl32/theme_listbox.c
reactos/dll/win32/comctl32/treeview.c

index 080310f..aa7c38e 100644 (file)
@@ -10637,8 +10637,10 @@ static BOOL LISTVIEW_NCPaint(const LISTVIEW_INFO *infoPtr, HRGN region)
         CombineRgn (cliprgn, cliprgn, region, RGN_AND);
     OffsetRect(&r, -r.left, -r.top);
 
-    dc = GetDCEx(infoPtr->hwndSelf, region, DCX_WINDOW|DCX_INTERSECTRGN);
-    OffsetRect(&r, -r.left, -r.top);
+    dc = GetWindowDC(infoPtr->hwndSelf);
+    /* Exclude client part */
+    ExcludeClipRect(dc, r.left + cxEdge, r.top + cyEdge,
+        r.right - cxEdge, r.bottom -cyEdge);
 
     if (IsThemeBackgroundPartiallyTransparent (theme, 0, 0))
         DrawThemeParentBackground(infoPtr->hwndSelf, dc, &r);
index bbf5827..8452181 100644 (file)
@@ -52,9 +52,11 @@ static void nc_paint (HTHEME theme, HWND hwnd, HRGN region)
             CombineRgn (cliprgn, cliprgn, region, RGN_AND);
         OffsetRect(&r, -r.left, -r.top);
     
-        dc = GetDCEx(hwnd, region, DCX_WINDOW|DCX_INTERSECTRGN);
-        OffsetRect(&r, -r.left, -r.top);
-    
+        dc = GetWindowDC(hwnd);
+        /* Exclude client part */
+        ExcludeClipRect(dc, r.left + cxEdge, r.top + cyEdge,
+            r.right - cxEdge, r.bottom -cyEdge);
+
         if (IsThemeBackgroundPartiallyTransparent (theme, part, state))
             DrawThemeParentBackground(hwnd, dc, &r);
         DrawThemeBackground (theme, dc, part, state, &r, 0);
index e6ce023..c7a2940 100644 (file)
@@ -42,9 +42,11 @@ static void nc_paint (HTHEME theme, HWND hwnd, HRGN region)
             CombineRgn (cliprgn, cliprgn, region, RGN_AND);
         OffsetRect(&r, -r.left, -r.top);
     
-        dc = GetDCEx(hwnd, region, DCX_WINDOW|DCX_INTERSECTRGN);
-        OffsetRect(&r, -r.left, -r.top);
-    
+        dc = GetWindowDC(hwnd);
+        /* Exclude client part */
+        ExcludeClipRect(dc, r.left + cxEdge, r.top + cyEdge,
+            r.right - cxEdge, r.bottom -cyEdge);
+
         if (IsThemeBackgroundPartiallyTransparent (theme, 0, 0))
             DrawThemeParentBackground(hwnd, dc, &r);
         DrawThemeBackground (theme, dc, 0, 0, &r, 0);
index e605723..27f99ee 100644 (file)
@@ -5429,8 +5429,10 @@ static BOOL TREEVIEW_NCPaint (const TREEVIEW_INFO *infoPtr, HRGN region, LPARAM
         CombineRgn (cliprgn, cliprgn, region, RGN_AND);
     OffsetRect(&r, -r.left, -r.top);
 
-    dc = GetDCEx(infoPtr->hwnd, region, DCX_WINDOW|DCX_INTERSECTRGN);
-    OffsetRect(&r, -r.left, -r.top);
+    dc = GetWindowDC(infoPtr->hwnd);
+    /* Exclude client part */
+    ExcludeClipRect(dc, r.left + cxEdge, r.top + cyEdge,
+        r.right - cxEdge, r.bottom -cyEdge);
 
     if (IsThemeBackgroundPartiallyTransparent (theme, 0, 0))
         DrawThemeParentBackground(infoPtr->hwnd, dc, &r);