From: Dmitry Timoshkov dmitry@baikal.ru
Themed Delphi applications use "explorer::listview" and "explorer::treeview": https://gitlab.com/freepascal.org/lazarus/lazarus/-/blob/main/lcl/interfaces...
Signed-off-by: Dmitry Timoshkov dmitry@baikal.ru --- dlls/uxtheme/system.c | 18 +++++++++++++++++- dlls/uxtheme/tests/system.c | 2 +- 2 files changed, 18 insertions(+), 2 deletions(-)
diff --git a/dlls/uxtheme/system.c b/dlls/uxtheme/system.c index 156051406e3..f913316e12d 100644 --- a/dlls/uxtheme/system.c +++ b/dlls/uxtheme/system.c @@ -633,13 +633,29 @@ static HTHEME open_theme_data(HWND hwnd, LPCWSTR pszClassList, DWORD flags, UINT
if(bThemeActive) { + const WCHAR *p; + pszAppName = UXTHEME_GetWindowProperty(hwnd, atSubAppName, szAppBuff, ARRAY_SIZE(szAppBuff)); /* If SetWindowTheme was used on the window, that overrides the class list passed to this function */ pszUseClassList = UXTHEME_GetWindowProperty(hwnd, atSubIdList, szClassBuff, ARRAY_SIZE(szClassBuff)); if(!pszUseClassList) pszUseClassList = pszClassList;
- if (pszUseClassList) + p = wcschr(pszClassList, ':'); + if (p) + { + /* If the application class is already set then fail */ + if (!pszAppName) + { + p++; + lstrcpynW(szAppBuff, pszUseClassList, min(p - pszUseClassList, 256)); + szAppBuff[p - pszUseClassList] = 0; + if (*p == ':') p++; + lstrcpynW(szClassBuff, p, min(wcslen(p) + 1, 256)); + hTheme = MSSTYLES_OpenThemeClass(szAppBuff, szClassBuff, dpi); + } + } + else hTheme = MSSTYLES_OpenThemeClass(pszAppName, pszUseClassList, dpi);
/* Fall back to default class if the specified subclass is not found */ diff --git a/dlls/uxtheme/tests/system.c b/dlls/uxtheme/tests/system.c index d305d0bcd24..eddf9fbf484 100644 --- a/dlls/uxtheme/tests/system.c +++ b/dlls/uxtheme/tests/system.c @@ -2584,7 +2584,7 @@ static void test_theme(void) for (i = 0; i < ARRAY_SIZE(app_class); i++) { htheme = OpenThemeData(hwnd, app_class[i]); - todo_wine_if(i == 3 || i == 6 || i == 12 || i == 15 || i == 16 || i == 21) + todo_wine_if(i == 3 || i == 6 || i == 12 || i == 15 || i == 16) ok(htheme != NULL, "OpenThemeData(%s) error %#lx.\n", wine_dbgstr_w(app_class[i]), GetLastError()); CloseThemeData(htheme); }