Technical support does not know why you need to change themed text color, but knows how to do this for any UI theme:
class CMyToolBarButtonWithRedTextColor : public CExtBarButton
{
public:
CMyToolBarButtonWithRedTextColor( CExtToolControlBar * pBar = NULL, UINT nCmdID = ID_SEPARATOR, UINT nStyle = 0 )
: CExtBarButton( pBar, nCmdID, nStyle )
{
}
void PaintCompound( CDC & dc, bool bPaintParentChain, bool bPaintChildren, bool bPaintOneNearestChildrenLevelOnly )
{
ASSERT_VALID( this );
ASSERT_VALID( (&dc) );
ASSERT( dc.GetSafeHdc() != NULL );
CExtToolControlBar * pBar = GetBar();
ASSERT_VALID( pBar );
if( ! IsPaintAble( dc ) )
return;
if( AnimationClient_StatePaint( dc ) )
return;
if( bPaintParentChain )
PaintParentChain( dc );
CWnd * pCtrl = CtrlGet();
if( ( pCtrl != NULL )
&& ( ( ! m_bVertDocked )
|| GetCtrlVisibleVertically()
)
)
return;
CRect rcArea( m_ActiveRect );
if( rcArea.right <= rcArea.left || rcArea.bottom <= rcArea.top )
return;
if( (! IsVisible() ) || ( GetStyle() & TBBS_HIDDEN ) != 0 || (! dc.RectVisible(&m_ActiveRect) ) )
return;
bool bDockSiteCustomizeMode = pBar->_IsDockSiteCustomizeMode();
bool bPushed = ( IsPressed() && (!bDockSiteCustomizeMode) ) ? true : false;
bool bEnabled = ( IsDisabled() && (!bDockSiteCustomizeMode) ) ? false : true;
bool bHover = ( IsHover() && (!bDockSiteCustomizeMode) ) ? true : false;
if( (! bDockSiteCustomizeMode ) && (! GetBar()->IsForceHoverWhenMenuTracking() ) )
{
if( CExtToolControlBar::g_bMenuTracking || CExtPopupMenuWnd::IsMenuTracking() )
bHover = false;
else if( !bHover )
bHover = IsPressedTracking();
}
bool bIndeterminate = ( IsIndeterminate() && (!bDockSiteCustomizeMode) ) ? true : false;
CExtSafeString sText = GetText();
CExtCmdIcon * pIcon = GetIconPtr();
CExtCmdIcon * pIconLarge = NULL;
if( pIcon != NULL && (! pIcon->IsEmpty() ) && IsLargeIcon() )
{
CSize _sizeIcon = pIcon->GetSize();
_sizeIcon.cx *= 2;
_sizeIcon.cy *= 2;
pIconLarge = new CExtCmdIcon;
if( pIconLarge->CreateScaledCopy( *pIcon, _sizeIcon ) )
pIcon = pIconLarge;
}
bool bHorz = IsHorzBarOrientation();
HFONT hFont = (HFONT) pBar -> OnGetToolbarFont( ! bHorz, false ) -> GetSafeHandle();
CExtPaintManager::PAINTPUSHBUTTONDATA _ppbd(
this, bHorz, rcArea, sText, pIcon, true, bHover, bPushed, bIndeterminate, bEnabled, m_bDrawBorder, false, false, 0,
hFont, ( IsAbleToTrackMenu() && (! pBar->_IsSimplifiedDropDownButtons() ) ) ? true : false, 0,
(!bEnabled) || ( bEnabled && (!bHover) && (!bPushed) )
);
_ppbd.m_rcBorderSizes = OnQueryBorderSizes( bHorz );
_ppbd.m_nIconAlignment = OnQueryAlignmentIcon( bHorz );
_ppbd.m_nTextAlignment = OnQueryAlignmentText( bHorz );
_ppbd.m_rcIconMargins = OnQueryMarginsIcon( bHorz );
_ppbd.m_rcTextMargins = OnQueryMarginsText( bHorz );
if( OnQueryMaxButtonWidth( bHorz ) >= 0 )
_ppbd.m_bWordBreak = true;
if( GetSeparatedDropDown() )
{
_ppbd.m_bSeparatedDropDown = true;
_ppbd.m_bHoverDropDown = m_bDropDownHT;
if( m_bDropDownHT && bPushed && ( ! bDockSiteCustomizeMode ) )
_ppbd.m_bPushedDropDown = true;
}
_ppbd.m_clrCustomAccentEffectForIcon = OnQueryCustomAccentEffectForIcon( dc );
bool bChecked = ( ( GetStyle() & TBBS_CHECKED ) != 0 ) ? true : false;
_ppbd.m_bChecked = bChecked;
////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////
// we need red text color
_ppbd.m_clrForceTextNormal = RGB(255,0,0);
////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////
pBar->PmBridge_GetPM()->PaintPushButton( dc, _ppbd );
#if (!defined __EXT_MFC_NO_CUSTOMIZE)
CExtCustomizeSite * pSite = pBar->GetCustomizeSite();
if( pSite != NULL && pSite->IsCustomizeMode() && pSite->CustomizedNodeGet() != NULL && pSite->CustomizedNodeGet() == GetCmdNode( false ) )
pBar->PmBridge_GetPM()->PaintDragSourceRect( dc, rcArea );
#endif
if( pIconLarge != NULL )
delete pIconLarge;
if( bPaintChildren )
PaintChildren( dc, bPaintOneNearestChildrenLevelOnly );
}
};
class CMyMenuBar : public CExtMenuControlBar
{
public:
CExtBarButton * OnCreateBarCommandBtn( UINT nCmdID, UINT nStyle = 0 )
{
ASSERT_VALID( this );
CExtBarButton * pTBB = new CMyToolBarButtonWithRedTextColor( this, nCmdID, nStyle );
ASSERT_VALID( pTBB );
return pTBB;
}
};