From: Zhiyi Zhang <zzhang(a)codeweavers.com> --- dlls/comctl32/status.c | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/dlls/comctl32/status.c b/dlls/comctl32/status.c index 08dd44d2eaa..ec68b8d3e0c 100644 --- a/dlls/comctl32/status.c +++ b/dlls/comctl32/status.c @@ -84,8 +84,6 @@ typedef struct #define VERT_BORDER 2 #define HORZ_GAP 2 -static const WCHAR themeClass[] = L"Status"; - /* prototype */ static void STATUSBAR_SetPartBounds (STATUS_INFO *infoPtr); @@ -116,6 +114,7 @@ static void STATUSBAR_DrawSizeGrip (HWND hwnd, HDC hdc, LPRECT lpRect) { RECT rc = *lpRect; +#if __WINE_COMCTL32_VERSION == 6 HTHEME theme = GetWindowTheme(hwnd); if (theme) @@ -132,6 +131,7 @@ STATUSBAR_DrawSizeGrip (HWND hwnd, HDC hdc, LPRECT lpRect) return; } } +#endif TRACE("draw size grip %s\n", wine_dbgstr_rect(lpRect)); rc.left = max( rc.left, rc.right - GetSystemMetrics(SM_CXVSCROLL) - 1 ); @@ -144,6 +144,7 @@ STATUSBAR_DrawPartBackground (const STATUS_INFO *infoPtr, HDC hdc, const STATUSW int itemID, RECT *rect) { UINT border; +#if __WINE_COMCTL32_VERSION == 6 HTHEME theme = GetWindowTheme(infoPtr->Self); if (theme) @@ -156,6 +157,7 @@ STATUSBAR_DrawPartBackground (const STATUS_INFO *infoPtr, HDC hdc, const STATUSW DrawThemeBackground(theme, hdc, themePart, 0, rect, NULL); return; } +#endif if (part->style & SBT_POPOUT) border = BDR_RAISEDOUTER; @@ -216,6 +218,7 @@ static void STATUSBAR_DrawBackground (const STATUS_INFO *infoPtr, HDC hdc, const RECT *rect) { HBRUSH brush; +#if __WINE_COMCTL32_VERSION == 6 HTHEME theme = GetWindowTheme (infoPtr->Self); if (theme) @@ -223,6 +226,7 @@ STATUSBAR_DrawBackground (const STATUS_INFO *infoPtr, HDC hdc, const RECT *rect) DrawThemeBackground (theme, hdc, 0, 0, rect, NULL); return; } +#endif if (infoPtr->clrBk != CLR_DEFAULT) brush = CreateSolidBrush (infoPtr->clrBk); @@ -844,7 +848,7 @@ STATUSBAR_WMDestroy (STATUS_INFO *infoPtr) if (infoPtr->hwndToolTip) DestroyWindow (infoPtr->hwndToolTip); - CloseThemeData (GetWindowTheme (infoPtr->Self)); + COMCTL32_CloseThemeForWindow (infoPtr->Self); SetWindowLongPtrW(infoPtr->Self, 0, 0); Free (infoPtr); @@ -903,8 +907,8 @@ STATUSBAR_WMCreate (HWND hwnd, const CREATESTRUCTA *lpCreate) infoPtr->parts[0].x = -1; infoPtr->parts[0].style = 0; infoPtr->parts[0].hIcon = 0; - - OpenThemeData (hwnd, themeClass); + + COMCTL32_OpenThemeForWindow (hwnd, L"Status"); if (lpCreate->lpszName && (len = lstrlenW ((LPCWSTR)lpCreate->lpszName))) { @@ -1087,17 +1091,6 @@ STATUSBAR_WMSize (STATUS_INFO *infoPtr, WORD flags) } -/* update theme after a WM_THEMECHANGED message */ -static LRESULT theme_changed (const STATUS_INFO* infoPtr) -{ - HTHEME theme = GetWindowTheme (infoPtr->Self); - CloseThemeData (theme); - OpenThemeData (infoPtr->Self, themeClass); - InvalidateRect (infoPtr->Self, NULL, TRUE); - return 0; -} - - static LRESULT STATUSBAR_NotifyFormat (STATUS_INFO *infoPtr, HWND from, INT cmd) { @@ -1282,7 +1275,7 @@ StatusWindowProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) return 0; case WM_THEMECHANGED: - return theme_changed (infoPtr); + return COMCTL32_ThemeChanged (infoPtr->Self, L"Status", TRUE, TRUE); default: if ((msg >= WM_USER) && (msg < WM_APP) && !COMCTL32_IsReflectedMessage(msg)) -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/9433