From: Mark Harmstone Subject: [PATCH] comctl32: Add themed static control stub. Message-Id: <551AE970.8030509@burntcomma.com> Date: Tue, 31 Mar 2015 19:37:36 +0100 Patch to add a stub for themed static controls in comctl32. Some provision for themed statics is necessary, as otherwise they wouldn't be drawn with a transparent background. Wine currently achieves this by subclassing #32770, the dialog class, but this appears to be wrong - the global atom table shows that Microsoft's comctl32 subclasses Static instead. --- dlls/comctl32/Makefile.in | 1 + dlls/comctl32/theme_static.c | 44 ++++++++++++++++++++++++++++++++++++++++++++ dlls/comctl32/theming.c | 9 +++++++-- 3 files changed, 52 insertions(+), 2 deletions(-) create mode 100644 dlls/comctl32/theme_static.c diff --git a/dlls/comctl32/Makefile.in b/dlls/comctl32/Makefile.in index 27f9741..79e2f26 100644 --- a/dlls/comctl32/Makefile.in +++ b/dlls/comctl32/Makefile.in @@ -36,6 +36,7 @@ C_SRCS = \ theme_edit.c \ theme_listbox.c \ theme_scrollbar.c \ + theme_static.c \ theming.c \ toolbar.c \ tooltips.c \ diff --git a/dlls/comctl32/theme_static.c b/dlls/comctl32/theme_static.c new file mode 100644 index 0000000..29a4801 --- /dev/null +++ b/dlls/comctl32/theme_static.c @@ -0,0 +1,44 @@ +/* + * Theming - Scrollbar control + * + * Copyright (c) 2015 Mark Harmstone + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + * + */ + +#include +#include +#include + +#include "windef.h" +#include "winbase.h" +#include "wingdi.h" +#include "winuser.h" +#include "uxtheme.h" +#include "vssym32.h" +#include "comctl32.h" +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(theme_static); + +LRESULT CALLBACK THEMING_StaticSubclassProc (HWND hwnd, UINT msg, + WPARAM wParam, LPARAM lParam, + ULONG_PTR dwRefData) +{ + TRACE("(%p, 0x%x, %lu, %lu, %lu)\n", hwnd, msg, wParam, lParam, dwRefData); + + return THEMING_CallOriginalClass (hwnd, msg, wParam, lParam); +} diff --git a/dlls/comctl32/theming.c b/dlls/comctl32/theming.c index 93d6fe6..bc1ecb3 100644 --- a/dlls/comctl32/theming.c +++ b/dlls/comctl32/theming.c @@ -46,6 +46,8 @@ extern LRESULT CALLBACK THEMING_ListBoxSubclassProc (HWND, UINT, WPARAM, LPARAM, ULONG_PTR) DECLSPEC_HIDDEN; extern LRESULT CALLBACK THEMING_ScrollbarSubclassProc (HWND, UINT, WPARAM, LPARAM, ULONG_PTR) DECLSPEC_HIDDEN; +extern LRESULT CALLBACK THEMING_StaticSubclassProc (HWND, UINT, WPARAM, LPARAM, + ULONG_PTR) DECLSPEC_HIDDEN; static const WCHAR dialogClass[] = {'#','3','2','7','7','0',0}; static const WCHAR comboLboxClass[] = {'C','o','m','b','o','L','b','o','x',0}; @@ -62,7 +64,8 @@ static const struct ThemingSubclass {comboLboxClass, THEMING_ListBoxSubclassProc}, {WC_EDITW, THEMING_EditSubclassProc}, {WC_LISTBOXW, THEMING_ListBoxSubclassProc}, - {WC_SCROLLBARW, THEMING_ScrollbarSubclassProc} + {WC_SCROLLBARW, THEMING_ScrollbarSubclassProc}, + {WC_STATICW, THEMING_StaticSubclassProc} }; #define NUM_SUBCLASSES (sizeof(subclasses)/sizeof(subclasses[0])) @@ -99,6 +102,7 @@ MAKE_SUBCLASS_PROC(3) MAKE_SUBCLASS_PROC(4) MAKE_SUBCLASS_PROC(5) MAKE_SUBCLASS_PROC(6) +MAKE_SUBCLASS_PROC(7) static const WNDPROC subclassProcs[NUM_SUBCLASSES] = { subclass_proc0, @@ -107,7 +111,8 @@ static const WNDPROC subclassProcs[NUM_SUBCLASSES] = { subclass_proc3, subclass_proc4, subclass_proc5, - subclass_proc6 + subclass_proc6, + subclass_proc7 }; /***********************************************************************