X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6d4737120776b48a1bb4e8e5575329e213a50810..118322a3dfcc1803bd13df8193ea1be9ae39e653:/src/msw/tbar95.cpp diff --git a/src/msw/tbar95.cpp b/src/msw/tbar95.cpp index ef132e7408..944a1d0b27 100644 --- a/src/msw/tbar95.cpp +++ b/src/msw/tbar95.cpp @@ -46,6 +46,10 @@ #include "wx/msw/private.h" +#if wxUSE_UXTHEME +#include "wx/msw/uxtheme.h" +#endif + // include "properly" #include "wx/msw/wrapcctl.h" @@ -247,18 +251,25 @@ bool wxToolBar::Create(wxWindow *parent, SetFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT)); // workaround for flat toolbar on Windows XP classic style +#if wxUSE_UXTHEME if ( style & wxTB_FLAT ) { - DWORD dwToolbarStyle; + wxUxThemeEngine *p = wxUxThemeEngine::Get(); + if ( !p || !p->IsThemeActive() ) + { + DWORD dwToolbarStyle; - dwToolbarStyle = (DWORD)::SendMessage(GetHwnd(), TB_GETSTYLE, 0, 0L ); + dwToolbarStyle = (DWORD)::SendMessage(GetHwnd(), TB_GETSTYLE, 0, 0L ); - if ((dwToolbarStyle & TBSTYLE_FLAT) == 0) - { - dwToolbarStyle |= TBSTYLE_FLAT; - ::SendMessage(GetHwnd(), TB_SETSTYLE, 0, (LPARAM)dwToolbarStyle ); + if ((dwToolbarStyle & TBSTYLE_FLAT) == 0) + { + dwToolbarStyle |= TBSTYLE_FLAT; + ::SendMessage(GetHwnd(), TB_SETSTYLE, 0, (LPARAM)dwToolbarStyle ); + } } } +#endif + return TRUE; }