Index: src/ch/ThemedButton.cpp =================================================================== diff -u -r8068e0c351055554340ac9755d1bc846893bf2b8 -rafedcb6f4d37159266b6eaa97d8a7d0ce157de00 --- src/ch/ThemedButton.cpp (.../ThemedButton.cpp) (revision 8068e0c351055554340ac9755d1bc846893bf2b8) +++ src/ch/ThemedButton.cpp (.../ThemedButton.cpp) (revision afedcb6f4d37159266b6eaa97d8a7d0ce157de00) @@ -18,8 +18,6 @@ ***************************************************************************/ #include "stdafx.h" #include "ThemedButton.h" -#include "MemDC.h" -#include "Theme helpers.h" #ifdef _DEBUG #define new DEBUG_NEW @@ -64,24 +62,23 @@ void CThemedButton::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct) { CDC* pDC=CDC::FromHandle(lpDrawItemStruct->hDC); - CMemDC memdc(pDC, &lpDrawItemStruct->rcItem); + CMemDC memdc(*pDC, &lpDrawItemStruct->rcItem); bool bPushed=(lpDrawItemStruct->itemState & ODS_SELECTED); CRect rcItem=lpDrawItemStruct->rcItem; // draw button's frame - CUxThemeSupport uxTheme; - if (uxTheme.IsThemeSupported() && uxTheme.IsAppThemed()) + if (IsAppThemed()) { - HTHEME ht=uxTheme.OpenThemeData(lpDrawItemStruct->hwndItem, L"TOOLBAR"); + HTHEME ht=OpenThemeData(lpDrawItemStruct->hwndItem, L"TOOLBAR"); - uxTheme.DrawThemeParentBackground(lpDrawItemStruct->hwndItem, memdc.GetSafeHdc(), &rcItem); - uxTheme.DrawThemeBackground(ht, memdc.GetSafeHdc(), TP_BUTTON, bPushed ? TS_PRESSED : (m_bHovering ? TS_HOT : TS_NORMAL), &rcItem, nullptr); + DrawThemeParentBackground(lpDrawItemStruct->hwndItem, memdc.GetDC().GetSafeHdc(), &rcItem); + DrawThemeBackground(ht, memdc.GetDC().GetSafeHdc(), TP_BUTTON, bPushed ? TS_PRESSED : (m_bHovering ? TS_HOT : TS_NORMAL), &rcItem, nullptr); - uxTheme.CloseThemeData(ht); + CloseThemeData(ht); } else - DrawFrameControl(memdc.GetSafeHdc(), &rcItem, DFC_BUTTON, DFCS_ADJUSTRECT | DFCS_BUTTONPUSH | (bPushed ? DFCS_PUSHED : 0)); + DrawFrameControl(memdc.GetDC().GetSafeHdc(), &rcItem, DFC_BUTTON, DFCS_ADJUSTRECT | DFCS_BUTTONPUSH | (bPushed ? DFCS_PUSHED : 0)); ASSERT(m_pilList); // make sure the image list exist if(m_pilList) @@ -91,7 +88,7 @@ CRect rcBtn; GetClientRect(&rcBtn); - m_pilList->Draw(&memdc, m_iIndex, CPoint( ((rcBtn.Width()-cx)/2)+(bPushed ? 1 : 0), (rcBtn.Height()-cy)/2+(bPushed ? 1 : 0)), ILD_TRANSPARENT); + m_pilList->Draw(&memdc.GetDC(), m_iIndex, CPoint( ((rcBtn.Width()-cx)/2)+(bPushed ? 1 : 0), (rcBtn.Height()-cy)/2+(bPushed ? 1 : 0)), ILD_TRANSPARENT); } }