From: Zhiyi Zhang <zzhang(a)codeweavers.com> --- dlls/comctl32/comctl32.h | 1 + dlls/comctl32/commctrl.c | 5 +++++ dlls/comctl32_v6/button.c | 4 ++-- dlls/comctl32_v6/combo.c | 4 ++-- dlls/comctl32_v6/edit.c | 4 ++-- dlls/comctl32_v6/listbox.c | 4 ++-- 6 files changed, 14 insertions(+), 8 deletions(-) diff --git a/dlls/comctl32/comctl32.h b/dlls/comctl32/comctl32.h index 32e7658e22b..826f854640e 100644 --- a/dlls/comctl32/comctl32.h +++ b/dlls/comctl32/comctl32.h @@ -189,6 +189,7 @@ extern COMCTL32_SysColor comctl32_color; /* Internal function */ HWND COMCTL32_CreateToolTip(HWND); void COMCTL32_DrawStatusText(HDC hdc, LPCRECT lprc, LPCWSTR text, UINT style, BOOL draw_background); +void COMCTL32_OpenThemeForWindow(HWND hwnd, const WCHAR *theme_class); VOID COMCTL32_RefreshSysColors(void); void COMCTL32_DrawInsertMark(HDC hDC, const RECT *lpRect, COLORREF clrInsertMark, BOOL bHorizontal); void COMCTL32_EnsureBitmapSize(HBITMAP *pBitmap, int cxMinWidth, int cyMinHeight, COLORREF crBackground); diff --git a/dlls/comctl32/commctrl.c b/dlls/comctl32/commctrl.c index 4cb46fa7311..3a364ac8aba 100644 --- a/dlls/comctl32/commctrl.c +++ b/dlls/comctl32/commctrl.c @@ -3105,6 +3105,11 @@ LRESULT COMCTL32_forward_notify_to_ansi_window(HWND hwnd_notify, NMHDR *hdr, WCH return SendMessageW(hwnd_notify, WM_NOTIFY, hdr->idFrom, (LPARAM)hdr); } +void COMCTL32_OpenThemeForWindow(HWND hwnd, const WCHAR *theme_class) +{ + OpenThemeData(hwnd, theme_class); +} + /* A helper to handle CCM_SETVERSION messages */ LRESULT COMCTL32_SetVersion(INT *current_version, INT new_version) { diff --git a/dlls/comctl32_v6/button.c b/dlls/comctl32_v6/button.c index 1ad752fc861..b806fc1d0c2 100644 --- a/dlls/comctl32_v6/button.c +++ b/dlls/comctl32_v6/button.c @@ -536,7 +536,7 @@ static LRESULT CALLBACK BUTTON_WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, L SetWindowLongW( hWnd, GWL_STYLE, style ); } infoPtr->state = BST_UNCHECKED; - OpenThemeData( hWnd, WC_BUTTONW ); + COMCTL32_OpenThemeForWindow( hWnd, WC_BUTTONW ); parent = GetParent( hWnd ); if (parent) @@ -552,7 +552,7 @@ static LRESULT CALLBACK BUTTON_WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, L case WM_THEMECHANGED: theme = GetWindowTheme( hWnd ); CloseThemeData( theme ); - OpenThemeData( hWnd, WC_BUTTONW ); + COMCTL32_OpenThemeForWindow( hWnd, WC_BUTTONW ); InvalidateRect( hWnd, NULL, TRUE ); break; diff --git a/dlls/comctl32_v6/combo.c b/dlls/comctl32_v6/combo.c index 607e18a6f18..b8e0668525f 100644 --- a/dlls/comctl32_v6/combo.c +++ b/dlls/comctl32_v6/combo.c @@ -397,7 +397,7 @@ static void CBGetDroppedControlRect( LPHEADCOMBO lphc, LPRECT lpRect) */ static LRESULT COMBO_Create( HWND hwnd, LPHEADCOMBO lphc, HWND hwndParent, LONG style ) { - OpenThemeData( hwnd, WC_COMBOBOXW ); + COMCTL32_OpenThemeForWindow( hwnd, WC_COMBOBOXW ); if( !CB_GETTYPE(lphc) ) lphc->dwStyle |= CBS_SIMPLE; if( CB_GETTYPE(lphc) != CBS_DROPDOWNLIST ) lphc->wState |= CBF_EDIT; @@ -1696,7 +1696,7 @@ static LRESULT CALLBACK COMBO_WindowProc( HWND hwnd, UINT message, WPARAM wParam case WM_THEMECHANGED: theme = GetWindowTheme( hwnd ); CloseThemeData( theme ); - OpenThemeData( hwnd, WC_COMBOBOXW ); + COMCTL32_OpenThemeForWindow( hwnd, WC_COMBOBOXW ); InvalidateRect( hwnd, NULL, TRUE ); break; diff --git a/dlls/comctl32_v6/edit.c b/dlls/comctl32_v6/edit.c index 16a05d59101..f34fecaa1cf 100644 --- a/dlls/comctl32_v6/edit.c +++ b/dlls/comctl32_v6/edit.c @@ -4443,7 +4443,7 @@ static LRESULT EDIT_WM_Create(EDITSTATE *es, const WCHAR *name) /* force scroll info update */ EDIT_UpdateScrollInfo(es); - OpenThemeData(es->hwndSelf, WC_EDITW); + COMCTL32_OpenThemeForWindow(es->hwndSelf, WC_EDITW); /* The rule seems to return 1 here for success */ /* Power Builder masked edit controls will crash */ @@ -4994,7 +4994,7 @@ static LRESULT CALLBACK EDIT_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR case WM_THEMECHANGED: CloseThemeData(GetWindowTheme(hwnd)); - OpenThemeData(hwnd, WC_EDITW); + COMCTL32_OpenThemeForWindow(hwnd, WC_EDITW); InvalidateRect(hwnd, NULL, TRUE); break; diff --git a/dlls/comctl32_v6/listbox.c b/dlls/comctl32_v6/listbox.c index 01b14f36079..51da1c1daec 100644 --- a/dlls/comctl32_v6/listbox.c +++ b/dlls/comctl32_v6/listbox.c @@ -2653,7 +2653,7 @@ static BOOL LISTBOX_Create( HWND hwnd, LPHEADCOMBO lphc ) } } - OpenThemeData( descr->self, WC_LISTBOXW ); + COMCTL32_OpenThemeForWindow( descr->self, WC_LISTBOXW ); TRACE("owner: %p, style: %08x, width: %d, height: %d\n", descr->owner, descr->style, descr->width, descr->height); return TRUE; @@ -3160,7 +3160,7 @@ static LRESULT CALLBACK LISTBOX_WindowProc( HWND hwnd, UINT msg, WPARAM wParam, case WM_THEMECHANGED: theme = GetWindowTheme( hwnd ); CloseThemeData( theme ); - OpenThemeData( hwnd, WC_LISTBOXW ); + COMCTL32_OpenThemeForWindow( hwnd, WC_LISTBOXW ); InvalidateRect( hwnd, NULL, TRUE ); break; -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/9221