comctl32/static: Enable parent dialog tab texture.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zhiyi Zhang 2022-01-24 15:47:33 +08:00 committed by Alexandre Julliard
parent c5ba5e2ecb
commit 9083b1e8b1
2 changed files with 9 additions and 3 deletions

View File

@ -35,6 +35,7 @@
#include "wingdi.h"
#include "winuser.h"
#include "commctrl.h"
#include "uxtheme.h"
#include "wine/heap.h"
#include "wine/debug.h"
@ -432,12 +433,20 @@ static LRESULT CALLBACK STATIC_WindowProc( HWND hwnd, UINT uMsg, WPARAM wParam,
switch (uMsg)
{
case WM_CREATE:
{
HWND parent;
if (style < 0L || style > SS_TYPEMASK)
{
ERR("Unknown style 0x%02x\n", style );
return -1;
}
parent = GetParent( hwnd );
if (parent)
EnableThemeDialogTexture( parent, ETDT_ENABLE );
break;
}
case WM_NCDESTROY:
if (style == SS_ICON)

View File

@ -2097,7 +2097,6 @@ static void test_EnableThemeDialogTexture(void)
child_hdc = GetDC(child);
brush = (HBRUSH)SendMessageW(dialog, WM_CTLCOLORSTATIC, (WPARAM)child_hdc, (LPARAM)child);
if (class_tests[i].texture_enabled)
todo_wine_if(!lstrcmpA(class_tests[i].param.class_name, WC_STATICA))
ok(brush != GetSysColorBrush(COLOR_BTNFACE), "Expected tab texture enabled.\n");
else
ok(brush == GetSysColorBrush(COLOR_BTNFACE), "Expected tab texture disabled.\n");
@ -2121,7 +2120,6 @@ static void test_EnableThemeDialogTexture(void)
child_hdc = GetDC(child);
brush = (HBRUSH)SendMessageW(dialog, WM_CTLCOLORSTATIC, (WPARAM)child_hdc, (LPARAM)child);
if (class_tests[i].texture_enabled)
todo_wine_if(!lstrcmpA(class_tests[i].param.class_name, WC_STATICA))
ok(brush != GetSysColorBrush(COLOR_BTNFACE), "Expected tab texture enabled.\n");
else
ok(brush == GetSysColorBrush(COLOR_BTNFACE), "Expected tab texture disabled.\n");
@ -2142,7 +2140,6 @@ static void test_EnableThemeDialogTexture(void)
NULL);
ok(child != NULL, "CreateWindowA failed, error %d.\n", GetLastError());
ret = IsThemeDialogTextureEnabled(hwnd);
todo_wine
ok(ret, "Wrong dialog texture status.\n");
/* Test that if you move the child control to another window, it doesn't enables tab texture for