From 07e90782795a4760594899c1d8739b0bf13f9efe Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 1 Aug 2003 22:04:46 +0000 Subject: [PATCH] check for comctl32.dll version in wxUxThemeEngine::Initialize() git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@22456 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/msw/uxtheme.h | 4 ---- src/msw/uxtheme.cpp | 23 +++++++---------------- 2 files changed, 7 insertions(+), 20 deletions(-) diff --git a/include/wx/msw/uxtheme.h b/include/wx/msw/uxtheme.h index da91ed7d0e..2518a03bcf 100644 --- a/include/wx/msw/uxtheme.h +++ b/include/wx/msw/uxtheme.h @@ -310,10 +310,6 @@ public: wxUX_THEME_DECLARE(PFNWXUDRAWTHEMEPARENTBACKGROUND, DrawThemeParentBackground) wxUX_THEME_DECLARE(PFNWXUENABLETHEMING, EnableTheming) - // This calls IsAppThemed but also checks the commctrl.dll version - // for a more reliable answer. - bool IsAppThemedEx() ; - private: // construcor is private as only Get() can create us and is also trivial as // everything really happens in Initialize() diff --git a/src/msw/uxtheme.cpp b/src/msw/uxtheme.cpp index 328bb33bf2..f2155c45f7 100644 --- a/src/msw/uxtheme.cpp +++ b/src/msw/uxtheme.cpp @@ -108,6 +108,13 @@ wxUxThemeEngine* wxUxThemeEngine::Get() bool wxUxThemeEngine::Initialize() { + if ( wxTheApp->GetComCtl32Version() < 600 ) + { + // not using theme-aware comctl32.dll anyhow, don't even try to use + // themes + return false; + } + // we're prepared to handle the errors wxLogNull noLog; @@ -172,21 +179,5 @@ bool wxUxThemeEngine::Initialize() return true; } -// This calls IsAppThemed but also checks the commctrl.dll version -// for a more reliable answer. -bool wxUxThemeEngine::IsAppThemedEx() -{ - static bool g_TestedForTheme = FALSE; - static bool g_UseTheme = FALSE; - if (!g_TestedForTheme) - { - int commCtrlVersion = wxTheApp->GetComCtl32Version() ; - - g_UseTheme = (commCtrlVersion >= 600); - g_TestedForTheme = TRUE; - } - return IsAppThemed() && g_UseTheme; -} - #endif // wxUSE_UXTHEME -- 2.45.2