comctl32/toolbar: Don't use outside theme handles.
commit8107462b8aa9f91a5f0ada710e8d1c4d6a95a3a5
authorZhiyi Zhang <zzhang@codeweavers.com>
Tue, 22 Jun 2021 08:21:15 +0000 (22 16:21 +0800)
committerAlexandre Julliard <julliard@winehq.org>
Tue, 22 Jun 2021 15:57:46 +0000 (22 17:57 +0200)
tree9a376f1bd3f312c74ba499ff248b9b315fc8b6ff
parent677c459b86ae2785a63b373c68b8bb979f70d877
comctl32/toolbar: Don't use outside theme handles.

Fix Spy++ Toolbar buttons have artifacts. Spy++ first creates a Toolbar window, then calls
OpenThemeData(hwnd, "Rebar") with the Toolbar window. Then when the Toolbar control uses the theme
handle from GetWindowTheme(), it gets a Rebar theme the next time it draws, thus drawing wrong theme
parts.

According the tests, not all of the common controls have such behaviors. Some of them do have theme
handles opened by their window and then use that theme handle afterwards even it's changed from the
outside. However, for other controls, the behaviors are not very consistent across all Windows
versions. Also no applications depend on such behaviors for other controls yet. So, only modify the
Toolbar control for now.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
dlls/comctl32/tests/toolbar.c
dlls/comctl32/toolbar.c