From 7074e7ed5cbf8cb34f2d29d99ea408fb6e81a947 Mon Sep 17 00:00:00 2001 From: Chris Elliott Date: Wed, 29 Jun 2005 15:53:08 +0000 Subject: [PATCH] [ 1212972 ] fix dmc bug git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@34774 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/uxtheme.cpp | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/src/msw/uxtheme.cpp b/src/msw/uxtheme.cpp index 0b8d43bfe0..31fffe3889 100644 --- a/src/msw/uxtheme.cpp +++ b/src/msw/uxtheme.cpp @@ -41,26 +41,27 @@ #include "wx/msw/private.h" #include "wx/app.h" // for GetComCtl32Version +#if wxUSE_DYNLIB_CLASS +#include "wx/dynlib.h" +#endif + wxUxThemeEngine* g_pThemeEngine = ((wxUxThemeEngine*)NULL) ; BOOL wxCanUseInitThemeEngine() { - OSVERSIONINFOEX wxuosex ; - memset((void*)&wxuosex, 0, sizeof(OSVERSIONINFOEX)) ; - wxuosex.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX) ; - if(!GetVersionEx((LPOSVERSIONINFO)&wxuosex)) - { - wxuosex.dwOSVersionInfoSize = sizeof(OSVERSIONINFO) ; - if(!GetVersionEx((LPOSVERSIONINFO)&wxuosex)) - { - return FALSE ; - } - } - if ((wxuosex.dwMajorVersion == 5) && (wxuosex.dwMinorVersion > 0)) +#if wxUSE_DYNLIB_CLASS + //suppress errors if we don't find it -- that's expected on nonXP systems + wxLogNull NullLog ; + wxDynamicLibrary uxthemelib ( wxT("uxtheme.dll") ); + + if (uxthemelib.IsLoaded()) { + //just discard this for 2.4 branch - code is externsively rewritten in CVS HEAD + uxthemelib.Unload (); return (wxTheApp->GetComCtl32Version() >= 600) ; } else +#endif //wxUSE_DYNLIB_CLASS { return FALSE ; }