[uxtheme]

- Broadcast WM_THEMECHANGED when hook themes are activated
- Do not call UXTHEME_LoadTheme in the hook theme callback. It will now be called when the application gets WM_THEMECHANGED

svn path=/branches/GSoC_2011/ThemesSupport/; revision=53124
This commit is contained in:
Giannis Adamopoulos 2011-08-07 20:42:22 +00:00
parent 5aaa7a3281
commit d00aa9c19e
3 changed files with 10 additions and 6 deletions

View file

@ -79,7 +79,7 @@ static BOOL CALLBACK UXTHEME_broadcast_msg_enumchild (HWND hWnd, LPARAM msg)
}
/* Broadcast a message to *all* windows, including children */
static BOOL CALLBACK UXTHEME_broadcast_msg (HWND hWnd, LPARAM msg)
BOOL CALLBACK UXTHEME_broadcast_msg (HWND hWnd, LPARAM msg)
{
if (hWnd == NULL)
{

View file

@ -130,8 +130,6 @@ ThemeInitApiHook(UAPIHK State, PUSERAPIHOOK puah)
UAH_HOOK_MESSAGE(puah->WndProcArray, WM_THEMECHANGED);
UAH_HOOK_MESSAGE(puah->WndProcArray, WM_UAHINIT);
UXTHEME_LoadTheme();
return TRUE;
}
@ -143,6 +141,7 @@ ThemeHooksInstall()
{
PVOID lpFunc;
OSVERSIONINFO osvi;
BOOL ret;
lpFunc = GetProcAddress(GetModuleHandle("user32.dll"), "RegisterUserApiHook");
@ -153,7 +152,7 @@ ThemeHooksInstall()
if ( osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 1)
{
PREGISTER_UAH_WINXP lpfuncxp = (PREGISTER_UAH_WINXP)lpFunc;
return lpfuncxp(hDllInst, ThemeInitApiHook);
ret = lpfuncxp(hDllInst, ThemeInitApiHook);
}
else if ( osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 2)
{
@ -166,13 +165,17 @@ ThemeHooksInstall()
uah.m_dllname2 = NULL;
uah.m_funname2 = NULL;
return lpfunc2003(&uah);
ret = lpfunc2003(&uah);
}
else
{
UNIMPLEMENTED;
return FALSE;
ret = FALSE;
}
UXTHEME_broadcast_msg (NULL, WM_THEMECHANGED);
return ret;
}
BOOL WINAPI

View file

@ -96,6 +96,7 @@ HRESULT WINAPI ParseThemeIniFile(LPCWSTR pszIniFileName, LPWSTR pszUnknown,
extern void UXTHEME_InitSystem(HINSTANCE hInst);
extern void UXTHEME_LoadTheme(void);
extern BOOL CALLBACK UXTHEME_broadcast_msg (HWND hWnd, LPARAM msg);
/* No alpha blending */
#define ALPHABLEND_NONE 0