Cpaintdc DC (this );
Cfont font;
Cfont * poldfont = NULL;
Logfont font;
Font. lfheight = 16;
Font. lfwidth = 0;
Font. lfescapement = 0;
Font. lforientation = 0;
Font. lfweight = fw_normal;
Font. lfitalic = 0;
Font. lfstrikeout = 0;
Font. lfcharset = ansi_charset;
Font. lfoutprecision = out_default_precis;
Font. lfclipprecision = out_default_precis;
Font. lfquality = proof_quality;
Font. lfpitchandfamily = variable_pitch | ff_roman;
Font. lfunderline = 0;
Strcpy_s (font. lffacename, "");
Font. deleteobject ();
Font. createfontindirect (& font );
Poldfont = Dc. SelectObject (& font );
DC. setbkmode (transparent); // set the text background to transparent
// Determine which window is selected and set the font color of their title bars respectively
Crect RC (0, 0, 0, 0 );
(Cpropertypage *) getdlgitem (idc_diskinfo)-> getclientrect (& rc );
DC. settextcolor (RGB (10, 10, 10 ));
DC. textout (RC. Left + 15, RC. Top + 40, curdiskno, curdiskno. getlength ());
DC. textout (RC. Left + 15, RC. Top + 70, totaldisksize, totaldisksize. getlength ());
DC. textout (RC. Left + 15, RC. Top + 100, freedisksize, freedisksize. getlength ());
DC. SelectObject (poldfont );
The main parameters are: font. lfheight = 16; and strcpy_s (font. lffacename, "");
DC. SelectObject (poldfont); this is to load the new font and put it after the text settings are complete.