Réponse acceptée !
HFONT hfnt;
exemple création:
void __stdcall PrepareFontBold(HWND hEdit)
{
RECT rct;
GetClientRect(hEdit, &rct);
LOGFONT lf;
memset(&lf, 0, sizeof(LOGFONT));
lf.lfWeight = FW_BOLD;
lf.lfHeight = (long)-(rct.bottom * 3 / 4);
hfnt = CreateFontIndirect(&lf);
}
Reste plus qu'à affecter au controle et vérifier par GetTextExtentPoint32 si ne déborde pas du ClientRect.
ciao...
[ Lien ]
BruNews, MVP VC++