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


Changing a font in Windows dialog

Recommended Posts

civguy    308
Here''s what I''m doing
	CFont fntMy;
										DEFAULT_PITCH | FF_DONTCARE, "Courier");
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 this post

Link to post
Share on other sites
Zeblar Nagrim    150

LOGFONT logfont;

GetObject (GetStockObject (SYSTEM_FIXED_FONT), sizeof (LOGFONT), (PTSTR) &logfont);

HFONT hFont = CreateFontIndirect (&logfont);

if(hFont == NULL)
return false;


Zeblar Nagrim, Lord of Chaos

Share this post

Link to post
Share on other sites