// determine point where to output text
TEXTMETRIC tm;
GetTextMetrics(hDC, &tm);
CPoint p = CPoint(m_CenterPoint.x, m_CenterPoint.y + tm.tmHeight/ 2);
if (bSunken)
p.Offset(m_nBorder, m_nBorder);
// draw button caption depending upon button state
if (bEnabled) {
SetTextColor(hDC, GetSysColor(COLOR_BTNTEXT));
SetTextAlign(hDC, TA_CENTER | TA_BOTTOM);
ExtTextOut(hDC,p.x,p.y,ETO_CLIPPED,pRect,text,text.GetLength(),NULL);
}
else {
SetTextColor(hDC, GetSysColor(COLOR_3DHILIGHT));
ExtTextOut(hDC,p.x+1,p.y+1,ETO_CLIPPED,pRect,text,text.GetLength(),NULL);
SetTextColor(hDC, GetSysColor(COLOR_3DSHADOW));
ExtTextOut(hDC,p.x,p.y,ETO_CLIPPED,pRect,text,text.GetLength(),NULL);
}