We did not implement the font color option for the control bar’s caption because it is painted by the paint manager and each theme can have either a light string and a dark background or vice versa. So, generally the same font color can be well readable under one theme and bad looking under some other one.
If you need a custom color, you should override the CExtControlBar::DoPaintNC()
virtual method. Your method should be similar to the original one but you should modify the following part of code at the end of this method:
CExtSafeString sCaption;
OnGetBarCaptionText( __EBCT_SINGLE_CAPTION_DOCKED, sCaption );
CRgn rgnExclude;
if( rgnExclude.CreateRectRgnIndirect( &rcGrip ) )
pDC->SelectClipRgn( &rgnExclude );
CExtPaintManager::PAINTGRIPPERDATA _pgd(
this,
rcGrip,
rcText,
IsBarWindowActive(),
false,
bHorz && !bGripperAtTop,
!bFixedMode,
sCaption.IsEmpty() ? LPCTSTR( NULL ) : sCaption,
( (g_ResourceManager->OnQueryLangLayout()&LAYOUT_RTL) != 0 ) ? true : false
);
PmBridge_GetPM()->PaintGripper( *pDC, _pgd );
NcButtons_Paint( *pDC );
pDC->SelectClipRgn( NULL );
The
PmBridge_GetPM()->PaintGripper()
invokes the paint manager to draw the control bar’s caption depending on the current theme. The
pgd
data structure includes all the caption parameters for painting. The
rcText
variable contains a rectangle for painting the caption text. The
sCaption
variable contains the caption text itself. So, you should construct the
pgd
data structure using an empty string instead
sCaption
. This will not give the paint manager any chance to draw the default looking caption text. After the
PmBridge_GetPM()->PaintGripper()
code is invoked, you should draw the custom caption text using the
PmBridge_GetPM()->m_FontNormal
font and a custom font color.