I want all the controls (edit,list control, etc) in my application to be having the same font which is not the system default. How do i do this? Is there any Win32 API that sets the application default font?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Windows does not provide any mechanism for an application-wide font. Each window class may have its own behavior for choosing a font to use by default. It may try to select the font used by Windows shell dialogs, or it may simply draw its text using the horrid bitmap ‘system’ font automatically selected into new DCs.
The Windows common control window classes all respond to
WM_SETFONT, which is the standard window message for telling a window what font you want it to use. When you implement your own window classes (especially new child control window classes), you should also write a handler forWM_SETFONT:WM_SETFONThandler should forward the message to each of them.WM_SETFONThandler and select it into the DC you use when drawing your window.WM_SETFONTmessage.Note that the dialog manager does some of this for you; when instantiating a dialog template, the new dialog’s font is set to the font named in the template, and the dialog sends
WM_SETFONTall of its child controls.