#### Archived

This topic is now archived and is closed to further replies.

# Changing a font in Windows dialog

This topic is 6071 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Here''s what I''m doing
  CFont fntMy; fntMy.CreateFont(0,0,0,0,FW_NORMAL,0,0,0,DEFAULT_CHARSET, OUT_CHARACTER_PRECIS,CLIP_CHARACTER_PRECIS,DEFAULT_QUALITY, DEFAULT_PITCH | FF_DONTCARE, "Courier"); m_cResult.SetFont(&fntMy); 
Where m_cResult is the control to the edit box I want to change. This doesn''t work properly - it changes the font to something, but not to "Courier". And the font also bugs when I try to type with it. Do I have to enumerate the fonts to get the correct font name, or is there an easier way? All I need is Courier and I know everyone has that font. (the reason I need it is because it has fixed width. If you have any other idea on how to get fixed width for an edit box, I could use it as well )

##### Share on other sites
  LOGFONT logfont; GetObject (GetStockObject (SYSTEM_FIXED_FONT), sizeof (LOGFONT), (PTSTR) &logfont); HFONT hFont = CreateFontIndirect (&logfont); if(hFont == NULL) return false;m_cResult.SetFont(hFont);

Zeblar Nagrim, Lord of Chaos

1. 1
2. 2
3. 3
frob
15
4. 4
5. 5

• 11
• 20
• 12
• 13
• 14
• ### Forum Statistics

• Total Topics
632146
• Total Posts
3004433

×