From: Julian Smart Date: Sun, 1 Aug 2004 09:19:10 +0000 (+0000) Subject: Fix by George Wismer to get flat toolbars under Windows Classic style, X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/6d4737120776b48a1bb4e8e5575329e213a50810 Fix by George Wismer to get flat toolbars under Windows Classic style, by setting TBSTYLE_FLAT after toolbar creation git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28576 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/msw/tbar95.cpp b/src/msw/tbar95.cpp index 83fcc8a1e6..ef132e7408 100644 --- a/src/msw/tbar95.cpp +++ b/src/msw/tbar95.cpp @@ -246,6 +246,19 @@ bool wxToolBar::Create(wxWindow *parent, SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_MENUBAR)); SetFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT)); + // workaround for flat toolbar on Windows XP classic style + if ( style & wxTB_FLAT ) + { + DWORD dwToolbarStyle; + + dwToolbarStyle = (DWORD)::SendMessage(GetHwnd(), TB_GETSTYLE, 0, 0L ); + + if ((dwToolbarStyle & TBSTYLE_FLAT) == 0) + { + dwToolbarStyle |= TBSTYLE_FLAT; + ::SendMessage(GetHwnd(), TB_SETSTYLE, 0, (LPARAM)dwToolbarStyle ); + } + } return TRUE; } @@ -256,7 +269,7 @@ bool wxToolBar::MSWCreateToolbar(const wxPoint& pos, const wxSize& size) // toolbar-specific post initialisation ::SendMessage(GetHwnd(), TB_BUTTONSTRUCTSIZE, sizeof(TBBUTTON), 0); - + return TRUE; }