Commit 2adb11dd authored by Zhiyi Zhang's avatar Zhiyi Zhang Committed by Alexandre Julliard

uxtheme: Do not call SetWindowTheme() in EnableThemeDialogTexture().

It's no longer necessary to call SetWindowTheme() in EnableThemeDialogTexture() because dialog theming doesn't need to open theme handles associated with the dialog. Calling SetWindowTheme() also sends extra messages. Signed-off-by: 's avatarZhiyi Zhang <zzhang@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 1e8ce36e
......@@ -60,12 +60,7 @@ HRESULT WINAPI EnableThemeDialogTexture(HWND hwnd, DWORD dwFlags)
res = SetPropW (hwnd, (LPCWSTR)MAKEINTATOM(atDialogThemeEnabled),
UlongToHandle(dwFlags|0x80000000));
/* 0x80000000 serves as a "flags set" flag */
if (!res)
return HRESULT_FROM_WIN32(GetLastError());
if (dwFlags & ETDT_USETABTEXTURE)
return SetWindowTheme (hwnd, NULL, L"Tab");
else
return SetWindowTheme (hwnd, NULL, NULL);
return res ? S_OK : HRESULT_FROM_WIN32(GetLastError());
}
/***********************************************************************
......
......@@ -2018,7 +2018,7 @@ static void test_EnableThemeDialogTexture(void)
hr = EnableThemeDialogTexture(dialog, flags[i]);
ok(hr == S_OK, "EnableThemeDialogTexture failed, hr %#x.\n", hr);
ok_sequence(sequences, PARENT_SEQ_INDEX, empty_seq,
"EnableThemeDialogTexture first flag", TRUE);
"EnableThemeDialogTexture first flag", FALSE);
ret = IsThemeDialogTextureEnabled(dialog);
/* Non-zero flags without ETDT_DISABLE enables dialog texture */
todo_wine_if(flags[i] == ETDT_USETABTEXTURE || flags[i] == ETDT_USEAEROWIZARDTABTEXTURE)
......@@ -2040,7 +2040,7 @@ static void test_EnableThemeDialogTexture(void)
hr = EnableThemeDialogTexture(dialog, flags[j]);
ok(hr == S_OK, "EnableThemeDialogTexture failed, hr %#x.\n", hr);
ok_sequence(sequences, PARENT_SEQ_INDEX, empty_seq,
"EnableThemeDialogTexture second flag", TRUE);
"EnableThemeDialogTexture second flag", FALSE);
ret = IsThemeDialogTextureEnabled(dialog);
/* If the flag is zero, it will have previous dialog texture status */
if (flags[j])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment