On Mon Oct 23 17:07:19 2023 +0000, Dmitry Timoshkov wrote:
I just tested on Windows 10. It turns out you can't set the
application class
both with SetWindowTheme() and OpenThemeData(). If you do, OpenThemeData() fails. So please add some tests for that and change the OpenThemeData() implementation accordingly.
Probably I'm missing something, could you please elaborate how this patch is related to the described above behaviour? The only thing that the patch aims to fix is to make OpenThemeData() accept combined application/class names like "explorer::listview".
So if you call `SetWindowTheme(hwnd, L"explorer", NULL);` then call `OpenThemeData(hwnd, L"explorer::listview");`, the OpenThemeData() call should fail. So in your patch, there is no need to do checks like `pszAppName ? pszAppName : szAppBuff` because it shouldn't go that far. Instead, you should fail OpenThemeData() early if that happens, which is when an application class is already set and OpenThemeData() tries to use another application class.