更改Ribbon默认字体大小

struct AFX_OLDNONCLIENTMETRICS { UINT cbSize; int iBorderWidth; int iScrollWidth; int iScrollHeight; int iCaptionWidth; int iCaptionHeight; LOGFONT lfCaptionFont; int iSmCaptionWidth; int iSmCaptionHeight; LOGFONT lfSmCaptionFont; int iMenuWidth; int iMenuHeight; LOGFONT lfMenuFont; LOGFONT lfStatusFont; LOGFONT lfMessageFont; }; const UINT cbProperSize = sizeof(AFX_OLDNONCLIENTMETRICS);/*(_AfxGetComCtlVersion() < MAKELONG(1, 6)) ? sizeof(AFX_OLDNONCLIENTMETRICS) : sizeof(NONCLIENTMETRICS);*/ NONCLIENTMETRICS info; info.cbSize = cbProperSize; ::SystemParametersInfo(SPI_GETNONCLIENTMETRICS, cbProperSize, &info, 0); LONG prelfHeight = info.lfMenuFont.lfHeight; info.lfMenuFont.lfHeight = -13; ::SystemParametersInfo(SPI_SETNONCLIENTMETRICS, cbProperSize, &info, 0); afxGlobalData.UpdateFonts(); //还原 info.lfMenuFont.lfHeight = prelfHeight; ::SystemParametersInfo(SPI_SETNONCLIENTMETRICS, cbProperSize, &info, 0);

你可能感兴趣的:(VC技巧)