The MASM Forum Archive 2004 to 2012

General Forums => The Workshop => Topic started by: hotrod on January 21, 2010, 04:57:11 PM

Title: WM_GETFONT & LOGFONT
Post by: hotrod on January 21, 2010, 04:57:11 PM
I am running XP Pro SP3 and the following code returns the OEM font only to LOGFONT. Why?
BTW, I have tried GetStockObject also which works as advertised. Thanks...
invoke SendMessage, hWnd, WM_GETFONT, 0, 0
invoke GetObject, eax, sizeof LOGFONT, addr LF
Title: Re: WM_GETFONT & LOGFONT
Post by: MichaelW on January 21, 2010, 05:53:51 PM
If the control is using the system font, then the WM_GETFONT message should be returning null. The attachment is a quick demo based on a MASM32 in-memory dialog.
Title: Re: WM_GETFONT & LOGFONT
Post by: hotrod on January 21, 2010, 06:35:08 PM
Thanks MichaelW, I found a problem with my thinking after looking at your code. I did not notice the FONT directive in the .rc which was my problem because I was using ChooseFont after the dialog loaded which had a different font connected with it. Need to do a better job of investigating.