[UXTHEME] -Pass a non 0 wParam when themes get enabled and 0 when they get disabled

This commit is contained in:
Giannis Adamopoulos 2018-01-12 18:52:08 +02:00
parent b8062bde5d
commit 7e9f56229f
3 changed files with 13 additions and 13 deletions

View file

@ -58,23 +58,23 @@ int g_cHandles;
/***********************************************************************/
static BOOL CALLBACK UXTHEME_broadcast_msg_enumchild (HWND hWnd, LPARAM msg)
static BOOL CALLBACK UXTHEME_send_theme_changed (HWND hWnd, LPARAM enable)
{
SendMessageW(hWnd, msg, 0, 0);
SendMessageW(hWnd, WM_THEMECHANGED, enable, 0);
return TRUE;
}
/* Broadcast a message to *all* windows, including children */
BOOL CALLBACK UXTHEME_broadcast_msg (HWND hWnd, LPARAM msg)
/* Broadcast WM_THEMECHANGED to *all* windows, including children */
BOOL CALLBACK UXTHEME_broadcast_theme_changed (HWND hWnd, LPARAM enable)
{
if (hWnd == NULL)
{
EnumWindows (UXTHEME_broadcast_msg, msg);
EnumWindows (UXTHEME_broadcast_theme_changed, enable);
}
else
{
SendMessageW(hWnd, msg, 0, 0);
EnumChildWindows (hWnd, UXTHEME_broadcast_msg_enumchild, msg);
UXTHEME_send_theme_changed(hWnd, enable);
EnumChildWindows (hWnd, UXTHEME_send_theme_changed, enable);
}
return TRUE;
}
@ -658,7 +658,7 @@ HRESULT WINAPI EnableTheming(BOOL fEnable)
RegSetValueExW(hKey, szThemeActive, 0, REG_SZ, (LPBYTE)szEnabled, sizeof(WCHAR));
RegCloseKey(hKey);
}
UXTHEME_broadcast_msg (NULL, WM_THEMECHANGED);
UXTHEME_broadcast_theme_changed (NULL, fEnable);
}
return S_OK;
}
@ -884,7 +884,7 @@ HRESULT WINAPI SetWindowTheme(HWND hwnd, LPCWSTR pszSubAppName,
if (!SUCCEEDED(hr))
return hr;
UXTHEME_broadcast_msg (hwnd, WM_THEMECHANGED);
UXTHEME_broadcast_theme_changed (hwnd, TRUE);
return hr;
}
@ -1160,7 +1160,7 @@ HRESULT WINAPI ApplyTheme(HTHEMEFILE hThemeFile, char *unknown, HWND hWnd)
HRESULT hr;
TRACE("(%p,%s,%p)\n", hThemeFile, unknown, hWnd);
hr = UXTHEME_ApplyTheme(hThemeFile);
UXTHEME_broadcast_msg (NULL, WM_THEMECHANGED);
UXTHEME_broadcast_theme_changed (NULL, (g_ActiveThemeFile != NULL));
return hr;
}

View file

@ -697,7 +697,7 @@ ThemeHooksInstall()
ret = FALSE;
}
UXTHEME_broadcast_msg (NULL, WM_THEMECHANGED);
UXTHEME_broadcast_theme_changed (NULL, TRUE);
return ret;
}
@ -709,7 +709,7 @@ ThemeHooksRemove()
ret = UnregisterUserApiHook();
UXTHEME_broadcast_msg (NULL, WM_THEMECHANGED);
UXTHEME_broadcast_theme_changed (NULL, FALSE);
return ret;
}

View file

@ -256,7 +256,7 @@ extern BOOL g_bThemeHooksActive;
void UXTHEME_InitSystem(HINSTANCE hInst);
void UXTHEME_LoadTheme(BOOL bLoad);
BOOL CALLBACK UXTHEME_broadcast_msg (HWND hWnd, LPARAM msg);
BOOL CALLBACK UXTHEME_broadcast_theme_changed (HWND hWnd, LPARAM enable);
/* No alpha blending */
#define ALPHABLEND_NONE 0