Signed-off-by: Zhiyi Zhang zzhang@codeweavers.com --- dlls/uxtheme/system.c | 12 ++++-------- dlls/uxtheme/tests/system.c | 1 - 2 files changed, 4 insertions(+), 9 deletions(-)
diff --git a/dlls/uxtheme/system.c b/dlls/uxtheme/system.c index 8ced977c267..193e8f80538 100644 --- a/dlls/uxtheme/system.c +++ b/dlls/uxtheme/system.c @@ -571,20 +571,16 @@ BOOL WINAPI IsCompositionActive(void) HRESULT WINAPI EnableTheming(BOOL fEnable) { HKEY hKey; - WCHAR szEnabled[] = L"0";
TRACE("(%d)\n", fEnable);
- if(fEnable != bThemeActive) { - if(fEnable) - UXTHEME_BackupSystemMetrics(); - else - UXTHEME_RestoreSystemMetrics(); + if (bThemeActive && !fEnable) + { + UXTHEME_RestoreSystemMetrics(); UXTHEME_SaveSystemMetrics (); bThemeActive = fEnable; - if(bThemeActive) szEnabled[0] = '1'; if(!RegOpenKeyW(HKEY_CURRENT_USER, szThemeManager, &hKey)) { - RegSetValueExW(hKey, L"ThemeActive", 0, REG_SZ, (BYTE*)szEnabled, sizeof(WCHAR)); + RegSetValueExW(hKey, L"ThemeActive", 0, REG_SZ, (BYTE *)L"0", 2 * sizeof(WCHAR)); RegCloseKey(hKey); } UXTHEME_broadcast_msg (NULL, WM_THEMECHANGED); diff --git a/dlls/uxtheme/tests/system.c b/dlls/uxtheme/tests/system.c index a4ace2adfd3..3d85bffeaf7 100644 --- a/dlls/uxtheme/tests/system.c +++ b/dlls/uxtheme/tests/system.c @@ -1260,7 +1260,6 @@ static void test_EnableTheming(void)
hr = EnableTheming(TRUE); ok(hr == S_OK, "EnableTheming failed, hr %#x.\n", hr); - todo_wine ok(!IsThemeActive(), "Expected theming inactive.\n");
hr = EnableTheming(FALSE);