Jump to content
  • Advertisement


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


Changing a font in Windows dialog

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

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

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

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!