It's tedious. You need to use CWnd::GetFont()
on the button to get the font it's using, and then use the standard GetTextText
on a CDC
object where you will have selected that font.
It looks something like
CClientDC dc( &button );
CFont * pOldFont = dc.SelectObject( button.GetFont() );
... dc.GetTextExtent...
dc.SelectObject( pOldFont);
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…