From: Zhiyi Zhang zzhang@codeweavers.com
--- dlls/comctl32/trackbar.c | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-)
diff --git a/dlls/comctl32/trackbar.c b/dlls/comctl32/trackbar.c index 978fb283b7a..fb337202d9f 100644 --- a/dlls/comctl32/trackbar.c +++ b/dlls/comctl32/trackbar.c @@ -561,21 +561,35 @@ TRACKBAR_DrawTic (const TRACKBAR_INFO *infoPtr, HDC hdc, LONG ticPos, int flags) TRACKBAR_DrawOneTic (infoPtr, hdc, ticPos, flags & ~TBS_LEFT); }
-static void -TRACKBAR_DrawTics (const TRACKBAR_INFO *infoPtr, HDC hdc) +static COLORREF TRACKBAR_GetTicPenColor(const TRACKBAR_INFO *infoPtr) { - unsigned int i; - int ticFlags = infoPtr->dwStyle & 0x0f; - LOGPEN ticPen = { PS_SOLID, {1, 0}, GetSysColor (COLOR_3DDKSHADOW) }; - HPEN hOldPen, hTicPen; HTHEME theme = GetWindowTheme (infoPtr->hwndSelf); - + if (theme) { int part = (infoPtr->dwStyle & TBS_VERT) ? TKP_TICSVERT : TKP_TICS; - GetThemeColor (theme, part, TSS_NORMAL, TMT_COLOR, &ticPen.lopnColor); + COLORREF color; + + GetThemeColor (theme, part, TSS_NORMAL, TMT_COLOR, &color); + return color; } + + return GetSysColor (COLOR_3DDKSHADOW); +} + +static void +TRACKBAR_DrawTics (const TRACKBAR_INFO *infoPtr, HDC hdc) +{ + unsigned int i; + int ticFlags = infoPtr->dwStyle & 0x0f; + LOGPEN ticPen; + HPEN hOldPen, hTicPen; + /* create the pen to draw the tics with */ + ticPen.lopnStyle = PS_SOLID; + ticPen.lopnWidth.x = 1; + ticPen.lopnWidth.y = 0; + ticPen.lopnColor = TRACKBAR_GetTicPenColor(infoPtr); hTicPen = CreatePenIndirect(&ticPen); hOldPen = hTicPen ? SelectObject(hdc, hTicPen) : 0;
From: Zhiyi Zhang zzhang@codeweavers.com
--- dlls/comctl32/trackbar.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/comctl32/trackbar.c b/dlls/comctl32/trackbar.c index fb337202d9f..9b38a96470f 100644 --- a/dlls/comctl32/trackbar.c +++ b/dlls/comctl32/trackbar.c @@ -1759,7 +1759,7 @@ TRACKBAR_MouseMove (TRACKBAR_INFO *infoPtr, INT x, INT y)
if (!(infoPtr->flags & TB_DRAG_MODE)) { - if (GetWindowTheme (infoPtr->hwndSelf)) + if (COMCTL32_IsThemed (infoPtr->hwndSelf)) { DWORD oldFlags = infoPtr->flags; POINT pt;
From: Zhiyi Zhang zzhang@codeweavers.com
--- dlls/comctl32/trackbar.c | 52 ++++++++++++++++++---------------------- 1 file changed, 23 insertions(+), 29 deletions(-)
diff --git a/dlls/comctl32/trackbar.c b/dlls/comctl32/trackbar.c index 9b38a96470f..04faae1efcd 100644 --- a/dlls/comctl32/trackbar.c +++ b/dlls/comctl32/trackbar.c @@ -95,8 +95,6 @@ typedef struct #define TIC_SELECTIONMARKMIN 0x100 #define TIC_SELECTIONMARK (TIC_SELECTIONMARKMAX | TIC_SELECTIONMARKMIN)
-static const WCHAR themeClass[] = L"Trackbar"; - static inline int notify_customdraw (const TRACKBAR_INFO *infoPtr, NMCUSTOMDRAW *pnmcd, int stage) { @@ -461,22 +459,25 @@ static void TRACKBAR_DrawChannel (const TRACKBAR_INFO *infoPtr, HDC hdc) { RECT rcChannel = infoPtr->rcChannel; + +#if __WINE_COMCTL32_VERSION == 6 HTHEME theme = GetWindowTheme (infoPtr->hwndSelf);
if (theme) { - DrawThemeBackground (theme, hdc, - (infoPtr->dwStyle & TBS_VERT) ? - TKP_TRACKVERT : TKP_TRACK, TKS_NORMAL, &rcChannel, 0); + int part = (infoPtr->dwStyle & TBS_VERT) ? TKP_TRACKVERT : TKP_TRACK; + DrawThemeBackground (theme, hdc, part, TKS_NORMAL, &rcChannel, 0); + return; } - else +#endif + + DrawEdge (hdc, &rcChannel, EDGE_SUNKEN, BF_RECT | BF_ADJUST); + if (infoPtr->dwStyle & TBS_ENABLESELRANGE) { - DrawEdge (hdc, &rcChannel, EDGE_SUNKEN, BF_RECT | BF_ADJUST); - if (infoPtr->dwStyle & TBS_ENABLESELRANGE) { /* fill the channel */ - FillRect (hdc, &rcChannel, GetStockObject(WHITE_BRUSH)); - if (TRACKBAR_HasSelection(infoPtr)) - FillRect (hdc, &infoPtr->rcSelection, GetSysColorBrush(COLOR_HIGHLIGHT)); - } + /* fill the channel */ + FillRect (hdc, &rcChannel, GetStockObject (WHITE_BRUSH)); + if (TRACKBAR_HasSelection (infoPtr)) + FillRect (hdc, &infoPtr->rcSelection, GetSysColorBrush (COLOR_HIGHLIGHT)); } }
@@ -563,6 +564,7 @@ TRACKBAR_DrawTic (const TRACKBAR_INFO *infoPtr, HDC hdc, LONG ticPos, int flags)
static COLORREF TRACKBAR_GetTicPenColor(const TRACKBAR_INFO *infoPtr) { +#if __WINE_COMCTL32_VERSION == 6 HTHEME theme = GetWindowTheme (infoPtr->hwndSelf);
if (theme) @@ -573,6 +575,7 @@ static COLORREF TRACKBAR_GetTicPenColor(const TRACKBAR_INFO *infoPtr) GetThemeColor (theme, part, TSS_NORMAL, TMT_COLOR, &color); return color; } +#endif
return GetSysColor (COLOR_3DDKSHADOW); } @@ -708,10 +711,12 @@ TRACKBAR_FillThumb (const TRACKBAR_INFO *infoPtr, HDC hdc, HBRUSH hbrush) static void TRACKBAR_DrawThumb (TRACKBAR_INFO *infoPtr, HDC hdc) { - HTHEME theme = GetWindowTheme (infoPtr->hwndSelf); int PointDepth; HBRUSH brush;
+#if __WINE_COMCTL32_VERSION == 6 + HTHEME theme = GetWindowTheme (infoPtr->hwndSelf); + if (theme) { int partId; @@ -738,6 +743,7 @@ TRACKBAR_DrawThumb (TRACKBAR_INFO *infoPtr, HDC hdc)
return; } +#endif
if (infoPtr->dwStyle & WS_DISABLED || infoPtr->flags & TB_DRAG_MODE) { @@ -1573,8 +1579,8 @@ TRACKBAR_Create (HWND hwnd, const CREATESTRUCTW *lpcs) SendMessageW (infoPtr->hwndToolTip, TTM_ADDTOOLW, 0, (LPARAM)&ti); } } - - OpenThemeData (hwnd, themeClass); + + COMCTL32_OpenThemeForWindow (hwnd, L"Trackbar");
return 0; } @@ -1591,7 +1597,7 @@ TRACKBAR_Destroy (TRACKBAR_INFO *infoPtr) infoPtr->tics = NULL;
SetWindowLongPtrW (infoPtr->hwndSelf, 0, 0); - CloseThemeData (GetWindowTheme (infoPtr->hwndSelf)); + COMCTL32_CloseThemeForWindow (infoPtr->hwndSelf); Free (infoPtr);
return 0; @@ -1729,18 +1735,6 @@ TRACKBAR_Timer (TRACKBAR_INFO *infoPtr) return 0; }
- -/* update theme after a WM_THEMECHANGED message */ -static LRESULT theme_changed (const TRACKBAR_INFO* infoPtr) -{ - HTHEME theme = GetWindowTheme (infoPtr->hwndSelf); - CloseThemeData (theme); - OpenThemeData (infoPtr->hwndSelf, themeClass); - InvalidateRect (infoPtr->hwndSelf, NULL, FALSE); - return 0; -} - - static LRESULT TRACKBAR_MouseMove (TRACKBAR_INFO *infoPtr, INT x, INT y) { @@ -2068,7 +2062,7 @@ TRACKBAR_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) return TRACKBAR_StyleChanged (infoPtr, wParam, (LPSTYLESTRUCT)lParam);
case WM_THEMECHANGED: - return theme_changed (infoPtr); + return COMCTL32_ThemeChanged (infoPtr->hwndSelf, L"Trackbar", TRUE, FALSE);
case WM_TIMER: return TRACKBAR_Timer (infoPtr);
From: Zhiyi Zhang zzhang@codeweavers.com
--- dlls/comctl32/treeview.c | 133 ++++++++++++++++++++------------------- 1 file changed, 67 insertions(+), 66 deletions(-)
diff --git a/dlls/comctl32/treeview.c b/dlls/comctl32/treeview.c index fb06a727748..ebf4da7ce02 100644 --- a/dlls/comctl32/treeview.c +++ b/dlls/comctl32/treeview.c @@ -2363,6 +2363,71 @@ TREEVIEW_ToggleItemState(const TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *item) } }
+/* Draw the (+/-) signs */ +static void TREEVIEW_DrawItemLineSigns(const TREEVIEW_INFO *infoPtr, HDC hdc, + const TREEVIEW_ITEM *item, LONG centerx, LONG centery, + COLORREF clrBk) +{ + LONG height, width, rectsize, plussize; + HPEN new_pen, old_pen; + HTHEME theme = GetWindowTheme(infoPtr->hwnd); + + if (theme) + { + int state = (item->state & TVIS_EXPANDED) ? GLPS_OPENED : GLPS_CLOSED; + RECT glyphRect = item->rect; + + glyphRect.left = item->linesOffset; + glyphRect.right = item->stateOffset; + DrawThemeBackground(theme, hdc, TVP_GLYPH, state, &glyphRect, NULL); + return; + } + + height = item->rect.bottom - item->rect.top; + width = item->stateOffset - item->linesOffset; + rectsize = min(height, width) / 4; + /* plussize = ceil(rectsize * 3/4) */ + plussize = (rectsize + 1) * 3 / 4; + + new_pen = CreatePen(PS_SOLID, 0, GETLINECOLOR(infoPtr->clrLine)); + old_pen = SelectObject(hdc, new_pen); + + Rectangle(hdc, centerx - rectsize - 1, centery - rectsize - 1, centerx + rectsize + 2, + centery + rectsize + 2); + + SelectObject(hdc, old_pen); + DeleteObject(new_pen); + + /* draw +/- signs with current text color */ + new_pen = CreatePen(PS_SOLID, 0, GETTXTCOLOR(infoPtr->clrText)); + old_pen = SelectObject(hdc, new_pen); + + if (height < 18 || width < 18) + { + MoveToEx(hdc, centerx - plussize + 1, centery, NULL); + LineTo(hdc, centerx + plussize, centery); + + if (!(item->state & TVIS_EXPANDED) || (item->state & TVIS_EXPANDPARTIAL)) + { + MoveToEx(hdc, centerx, centery - plussize + 1, NULL); + LineTo(hdc, centerx, centery + plussize); + } + } + else + { + Rectangle(hdc, centerx - plussize + 1, centery - 1, centerx + plussize, centery + 2); + + if (!(item->state & TVIS_EXPANDED) || (item->state & TVIS_EXPANDPARTIAL)) + { + Rectangle(hdc, centerx - 1, centery - plussize + 1, centerx + 2, centery + plussize); + SetPixel(hdc, centerx - 1, centery, clrBk); + SetPixel(hdc, centerx + 1, centery, clrBk); + } + } + + SelectObject(hdc, old_pen); + DeleteObject(new_pen); +}
/* Painting *************************************************************/
@@ -2443,73 +2508,9 @@ TREEVIEW_DrawItemLines(const TREEVIEW_INFO *infoPtr, HDC hdc, const TREEVIEW_ITE * Display the (+/-) signs */
- if (infoPtr->dwStyle & TVS_HASBUTTONS) - { - if (item->cChildren) - { - HTHEME theme = GetWindowTheme(infoPtr->hwnd); - if (theme) - { - RECT glyphRect = item->rect; - glyphRect.left = item->linesOffset; - glyphRect.right = item->stateOffset; - DrawThemeBackground (theme, hdc, TVP_GLYPH, - (item->state & TVIS_EXPANDED) ? GLPS_OPENED : GLPS_CLOSED, - &glyphRect, NULL); - } - else - { - LONG height = item->rect.bottom - item->rect.top; - LONG width = item->stateOffset - item->linesOffset; - LONG rectsize = min(height, width) / 4; - /* plussize = ceil(rectsize * 3/4) */ - LONG plussize = (rectsize + 1) * 3 / 4; - - HPEN new_pen = CreatePen(PS_SOLID, 0, GETLINECOLOR(infoPtr->clrLine)); - HPEN old_pen = SelectObject(hdc, new_pen); - - Rectangle(hdc, centerx - rectsize - 1, centery - rectsize - 1, - centerx + rectsize + 2, centery + rectsize + 2); + if (infoPtr->dwStyle & TVS_HASBUTTONS && item->cChildren) + TREEVIEW_DrawItemLineSigns(infoPtr, hdc, item, centerx, centery, clrBk);
- SelectObject(hdc, old_pen); - DeleteObject(new_pen); - - /* draw +/- signs with current text color */ - new_pen = CreatePen(PS_SOLID, 0, GETTXTCOLOR(infoPtr->clrText)); - old_pen = SelectObject(hdc, new_pen); - - if (height < 18 || width < 18) - { - MoveToEx(hdc, centerx - plussize + 1, centery, NULL); - LineTo(hdc, centerx + plussize, centery); - - if (!(item->state & TVIS_EXPANDED) || - (item->state & TVIS_EXPANDPARTIAL)) - { - MoveToEx(hdc, centerx, centery - plussize + 1, NULL); - LineTo(hdc, centerx, centery + plussize); - } - } - else - { - Rectangle(hdc, centerx - plussize + 1, centery - 1, - centerx + plussize, centery + 2); - - if (!(item->state & TVIS_EXPANDED) || - (item->state & TVIS_EXPANDPARTIAL)) - { - Rectangle(hdc, centerx - 1, centery - plussize + 1, - centerx + 2, centery + plussize); - SetPixel(hdc, centerx - 1, centery, clrBk); - SetPixel(hdc, centerx + 1, centery, clrBk); - } - } - - SelectObject(hdc, old_pen); - DeleteObject(new_pen); - } - } - } SelectObject(hdc, hbrOld); DeleteObject(hbr); }
From: Zhiyi Zhang zzhang@codeweavers.com
--- dlls/comctl32/treeview.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-)
diff --git a/dlls/comctl32/treeview.c b/dlls/comctl32/treeview.c index ebf4da7ce02..1ec3cc831c7 100644 --- a/dlls/comctl32/treeview.c +++ b/dlls/comctl32/treeview.c @@ -2902,13 +2902,23 @@ TREEVIEW_EraseBackground(const TREEVIEW_INFO *infoPtr, HDC hdc) return 1; }
+static void TREEVIEW_FillThemeBackground(TREEVIEW_INFO *infoPtr, HDC hdc, const RECT *rect) +{ + HTHEME theme; + + if (infoPtr->dwStyle & TVS_HASBUTTONS && (theme = GetWindowTheme(infoPtr->hwnd))) + { + if (IsThemeBackgroundPartiallyTransparent(theme, TVP_GLYPH, 0)) + FillRect(hdc, rect, (HBRUSH)(COLOR_WINDOW + 1)); + } +} + static void TREEVIEW_Refresh(TREEVIEW_INFO *infoPtr, HDC hdc, const RECT *rc) { HWND hwnd = infoPtr->hwnd; RECT rect = *rc; TREEVIEW_ITEM *item; - HTHEME theme;
if (infoPtr->clientHeight == 0 || infoPtr->clientWidth == 0) { @@ -2925,11 +2935,7 @@ TREEVIEW_Refresh(TREEVIEW_INFO *infoPtr, HDC hdc, const RECT *rc) return; }
- if (infoPtr->dwStyle & TVS_HASBUTTONS && (theme = GetWindowTheme(infoPtr->hwnd))) - { - if (IsThemeBackgroundPartiallyTransparent(theme, TVP_GLYPH, 0)) - FillRect(hdc, &rect, (HBRUSH)(COLOR_WINDOW + 1)); - } + TREEVIEW_FillThemeBackground(infoPtr, hdc, &rect);
for (item = infoPtr->root->firstChild; item != NULL;
From: Zhiyi Zhang zzhang@codeweavers.com
--- dlls/comctl32/treeview.c | 77 +++++++++------------------------------- 1 file changed, 16 insertions(+), 61 deletions(-)
diff --git a/dlls/comctl32/treeview.c b/dlls/comctl32/treeview.c index 1ec3cc831c7..0618eeacf84 100644 --- a/dlls/comctl32/treeview.c +++ b/dlls/comctl32/treeview.c @@ -195,9 +195,6 @@ typedef struct _TREEITEM /* HTREEITEM is a _TREEINFO *. */ #define GETTXTCOLOR(x) ((x) == CLR_NONE ? comctl32_color.clrWindowText : (x)) #define GETINSCOLOR(x) ((x) == CLR_DEFAULT ? comctl32_color.clrBtnText : (x))
-static const WCHAR themeClass[] = L"Treeview"; - - typedef VOID (*TREEVIEW_ItemEnumFunc)(TREEVIEW_INFO *, TREEVIEW_ITEM *,LPVOID);
@@ -2370,6 +2367,8 @@ static void TREEVIEW_DrawItemLineSigns(const TREEVIEW_INFO *infoPtr, HDC hdc, { LONG height, width, rectsize, plussize; HPEN new_pen, old_pen; + +#if __WINE_COMCTL32_VERSION == 6 HTHEME theme = GetWindowTheme(infoPtr->hwnd);
if (theme) @@ -2382,6 +2381,7 @@ static void TREEVIEW_DrawItemLineSigns(const TREEVIEW_INFO *infoPtr, HDC hdc, DrawThemeBackground(theme, hdc, TVP_GLYPH, state, &glyphRect, NULL); return; } +#endif
height = item->rect.bottom - item->rect.top; width = item->stateOffset - item->linesOffset; @@ -2902,6 +2902,7 @@ TREEVIEW_EraseBackground(const TREEVIEW_INFO *infoPtr, HDC hdc) return 1; }
+#if __WINE_COMCTL32_VERSION == 6 static void TREEVIEW_FillThemeBackground(TREEVIEW_INFO *infoPtr, HDC hdc, const RECT *rect) { HTHEME theme; @@ -2912,6 +2913,7 @@ static void TREEVIEW_FillThemeBackground(TREEVIEW_INFO *infoPtr, HDC hdc, const FillRect(hdc, rect, (HBRUSH)(COLOR_WINDOW + 1)); } } +#endif
static void TREEVIEW_Refresh(TREEVIEW_INFO *infoPtr, HDC hdc, const RECT *rc) @@ -2935,7 +2937,9 @@ TREEVIEW_Refresh(TREEVIEW_INFO *infoPtr, HDC hdc, const RECT *rc) return; }
+#if __WINE_COMCTL32_VERSION == 6 TREEVIEW_FillThemeBackground(infoPtr, hdc, &rect); +#endif
for (item = infoPtr->root->firstChild; item != NULL; @@ -2975,6 +2979,7 @@ TREEVIEW_Invalidate(const TREEVIEW_INFO *infoPtr, const TREEVIEW_ITEM *item) InvalidateRect(infoPtr->hwnd, NULL, TRUE); }
+#if __WINE_COMCTL32_VERSION == 6 static BOOL TREEVIEW_InitThemedCheckboxes(TREEVIEW_INFO *info) { HBITMAP bitmap, old_bitmap; @@ -3020,6 +3025,7 @@ static BOOL TREEVIEW_InitThemedCheckboxes(TREEVIEW_INFO *info) info->stateImageHeight = size.cy; return TRUE; } +#endif /* __WINE_COMCTL32_VERSION == 6 */
static void TREEVIEW_InitCheckboxes(TREEVIEW_INFO *infoPtr) @@ -3029,8 +3035,10 @@ TREEVIEW_InitCheckboxes(TREEVIEW_INFO *infoPtr) HBITMAP hbm, hbmOld; HDC hdc, hdcScreen;
+#if __WINE_COMCTL32_VERSION == 6 if (TREEVIEW_InitThemedCheckboxes(infoPtr)) return; +#endif
width = 12 * GetDpiForWindow(infoPtr->hwnd) / 96 + 1; height = width; @@ -5249,8 +5257,8 @@ TREEVIEW_Create(HWND hwnd, const CREATESTRUCTW *lpcs) /* Make sure actual scrollbar state is consistent with uInternalStatus */ ShowScrollBar(hwnd, SB_VERT, FALSE); ShowScrollBar(hwnd, SB_HORZ, FALSE); - - OpenThemeData (hwnd, themeClass); + + COMCTL32_OpenThemeForWindow (hwnd, L"Treeview");
return 0; } @@ -5272,7 +5280,7 @@ TREEVIEW_Destroy(TREEVIEW_INFO *infoPtr) SetWindowLongPtrW(infoPtr->hwndEdit, GWLP_WNDPROC, (DWORD_PTR)infoPtr->wpEditOrig);
- CloseThemeData (GetWindowTheme (infoPtr->hwnd)); + COMCTL32_CloseThemeForWindow (infoPtr->hwnd);
/* Deassociate treeview from the window before doing anything drastic. */ SetWindowLongPtrW(infoPtr->hwnd, 0, 0); @@ -5517,48 +5525,6 @@ TREEVIEW_MouseMove (TREEVIEW_INFO * infoPtr, LPARAM lParam) return 0; }
-/* Draw themed border */ -static BOOL TREEVIEW_NCPaint (const TREEVIEW_INFO *infoPtr, HRGN region, LPARAM lParam) -{ - int cxEdge, cyEdge; - LONG ex_style; - HTHEME theme; - HDC dc; - RECT r; - HRGN cliprgn; - - ex_style = GetWindowLongW(infoPtr->hwnd, GWL_EXSTYLE); - if (!(ex_style & WS_EX_CLIENTEDGE)) - return DefWindowProcW(infoPtr->hwnd, WM_NCPAINT, (WPARAM)region, lParam); - - theme = GetWindowTheme(infoPtr->hwnd); - if (!theme) - return DefWindowProcW (infoPtr->hwnd, WM_NCPAINT, (WPARAM)region, lParam); - - GetWindowRect(infoPtr->hwnd, &r); - - cxEdge = GetSystemMetrics(SM_CXEDGE); - cyEdge = GetSystemMetrics(SM_CYEDGE); - cliprgn = CreateRectRgn (r.left + cxEdge, r.top + cyEdge, - r.right - cxEdge, r.bottom - cyEdge); - if (region != (HRGN)1) - CombineRgn (cliprgn, cliprgn, region, RGN_AND); - OffsetRect(&r, -r.left, -r.top); - - dc = GetDCEx(infoPtr->hwnd, region, DCX_WINDOW|DCX_INTERSECTRGN); - - if (IsThemeBackgroundPartiallyTransparent (theme, 0, 0)) - DrawThemeParentBackground(infoPtr->hwnd, dc, &r); - DrawThemeBackground (theme, dc, 0, 0, &r, 0); - ReleaseDC(infoPtr->hwnd, dc); - - /* Call default proc to get the scrollbars etc. painted */ - DefWindowProcW (infoPtr->hwnd, WM_NCPAINT, (WPARAM)cliprgn, 0); - DeleteObject(cliprgn); - - return TRUE; -} - static LRESULT TREEVIEW_Notify(const TREEVIEW_INFO *infoPtr, WPARAM wParam, LPARAM lParam) { @@ -5713,17 +5679,6 @@ TREEVIEW_KillFocus(const TREEVIEW_INFO *infoPtr) return 0; }
-/* update theme after a WM_THEMECHANGED message */ -static LRESULT TREEVIEW_ThemeChanged(const TREEVIEW_INFO *infoPtr) -{ - HTHEME theme = GetWindowTheme (infoPtr->hwnd); - CloseThemeData (theme); - OpenThemeData (infoPtr->hwnd, themeClass); - InvalidateRect (infoPtr->hwnd, NULL, TRUE); - return 0; -} - - static LRESULT WINAPI TREEVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { @@ -5929,7 +5884,7 @@ TREEVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) goto def;
case WM_NCPAINT: - return TREEVIEW_NCPaint (infoPtr, (HRGN)wParam, lParam); + return COMCTL32_NCPaint (infoPtr->hwnd, wParam, lParam, NULL);
case WM_NOTIFY: return TREEVIEW_Notify(infoPtr, wParam, lParam); @@ -5972,7 +5927,7 @@ TREEVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) return TREEVIEW_HandleTimer(infoPtr, wParam);
case WM_THEMECHANGED: - return TREEVIEW_ThemeChanged (infoPtr); + return COMCTL32_ThemeChanged (infoPtr->hwnd, L"Treeview", TRUE, TRUE);
case WM_VSCROLL: return TREEVIEW_VScroll(infoPtr, wParam);