
Пример кода:
class CMFCtestDlg : public CDialogEx
{
CFont m_headerFont;
//....
//...
BOOL OnInitDialog();
}
BOOL CMFCtestDlg::OnInitDialog()
{
//.......
//.......
CFont *pDefaultFont = pHeaderCtrl->GetFont();
LOGFONT lf{0};
if(pDefaultFont != nullptr && pDefaultFont->GetLogFont(&lf))
{
// If the font is MS Shell Dlg, use SystemParametersInfo to get the system font
if(_tcscmp(lf.lfFaceName, _T("MS Shell Dlg")) == 0)
{
if(SystemParametersInfo(SPI_GETICONTITLELOGFONT, sizeof(LOGFONT), &lf, 0))
{
lf.lfWeight = FW_BOLD;
m_headerFont.CreateFontIndirect(&lf);
pHeaderCtrl->SetFont(&m_headerFont);
}
}
}
}
Подробнее здесь: https://stackoverflow.com/questions/791 ... ge-its-att
Мобильная версия