uxtheme: Fall back to default class if the specified subclass is not found.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50113
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zhiyi Zhang 2021-06-21 17:14:43 +08:00 committed by Alexandre Julliard
parent 59f3758ecb
commit 3e9fbda43c
2 changed files with 5 additions and 1 deletions

View File

@ -634,6 +634,10 @@ HTHEME WINAPI OpenThemeDataEx(HWND hwnd, LPCWSTR pszClassList, DWORD flags)
if (pszUseClassList)
hTheme = MSSTYLES_OpenThemeClass(pszAppName, pszUseClassList);
/* Fall back to default class if the specified subclass is not found */
if (!hTheme)
hTheme = MSSTYLES_OpenThemeClass(NULL, pszUseClassList);
}
if(IsWindow(hwnd))
SetPropW(hwnd, (LPCWSTR)MAKEINTATOM(atWindowTheme), hTheme);

View File

@ -127,7 +127,7 @@ todo_wine
ok(hRes == S_OK, "Expected S_OK, got 0x%08x.\n", hRes);
hTheme = OpenThemeData(hWnd, L"Button");
todo_wine ok(!!hTheme, "OpenThemeData failed.\n");
ok(!!hTheme, "OpenThemeData failed.\n");
CloseThemeData(hTheme);
}
else