The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: enevil on March 13, 2012, 05:18:02 AM

Title: CreateWindowEx Set Font
Post by: enevil on March 13, 2012, 05:18:02 AM
When create a window by CreateWindowEx,then how to Set font apply to all controls in the window?
Title: Re: CreateWindowEx Set Font
Post by: donkey on March 13, 2012, 06:27:54 AM
CreateWindowEx does not allow you to set the font for child windows, however you can enumerate the child windows with EnumChildWindows (http://msdn.microsoft.com/en-us/library/windows/desktop/ms633494%28v=vs.85%29.aspx) passing the font handle in lParam of the enumeration procedure.
Title: Re: CreateWindowEx Set Font
Post by: sinsi on March 13, 2012, 12:15:26 PM
If you creae the child windows in the main window's WM_CREATE handler you just create them then send a WM_SETFONT message to them with your font handle.