user32: Load uxtheme when theming is active.
In comctl32 DllMain(), IsThemeActive() is a delay-loaded function and shouldn't be called in DllMain(). Instead, tests showed that uxtheme should be loaded by user32. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51540 Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
cbf7bdce28
commit
eedad8a8ee
|
@ -208,9 +208,6 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
|
|||
TRACKBAR_Register ();
|
||||
TREEVIEW_Register ();
|
||||
UPDOWN_Register ();
|
||||
|
||||
/* Call IsThemeActive() so that delay-loaded uxtheme.dll is loaded for hooking user32 */
|
||||
IsThemeActive();
|
||||
break;
|
||||
|
||||
case DLL_PROCESS_DETACH:
|
||||
|
|
|
@ -539,6 +539,19 @@ static void register_builtin( const struct builtin_class_descr *descr )
|
|||
release_class_ptr( classPtr );
|
||||
}
|
||||
|
||||
static void load_uxtheme(void)
|
||||
{
|
||||
BOOL (WINAPI * pIsThemeActive)(void);
|
||||
HMODULE uxtheme;
|
||||
|
||||
uxtheme = LoadLibraryA("uxtheme.dll");
|
||||
if (uxtheme)
|
||||
{
|
||||
pIsThemeActive = (void *)GetProcAddress(uxtheme, "IsThemeActive");
|
||||
if (!pIsThemeActive || !pIsThemeActive())
|
||||
FreeLibrary(uxtheme);
|
||||
}
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* register_builtins
|
||||
|
@ -557,6 +570,9 @@ static BOOL WINAPI register_builtins( INIT_ONCE *once, void *param, void **conte
|
|||
register_builtin( &SCROLL_builtin_class );
|
||||
register_builtin( &STATIC_builtin_class );
|
||||
register_builtin( &IME_builtin_class );
|
||||
|
||||
/* Load uxtheme.dll so that standard scrollbars and dialogs are hooked for theming support */
|
||||
load_uxtheme();
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
|
|
@ -1511,6 +1511,7 @@ static void test_uxtheme(void)
|
|||
dll_loaded = !!GetModuleHandleA("comctl32.dll");
|
||||
ok(!dll_loaded, "Expected comctl32.dll not loaded.\n");
|
||||
dll_loaded = !!GetModuleHandleA("uxtheme.dll");
|
||||
todo_wine_if(dll_loaded)
|
||||
ok(!dll_loaded, "Expected uxtheme.dll not loaded.\n");
|
||||
|
||||
/* Creating a window triggers uxtheme load when theming is active */
|
||||
|
@ -1531,7 +1532,6 @@ static void test_uxtheme(void)
|
|||
is_theme_active = pIsThemeActive();
|
||||
FreeLibrary(uxtheme);
|
||||
|
||||
todo_wine_if(is_theme_active)
|
||||
ok(dll_loaded == is_theme_active, "Expected uxtheme %s when theming is %s.\n",
|
||||
is_theme_active ? "loaded" : "not loaded", is_theme_active ? "active" : "inactive");
|
||||
|
||||
|
|
Loading…
Reference in New Issue