News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Re: Associating Font to the Window

Started by caseys, December 31, 2010, 12:13:11 AM

Previous topic - Next topic

caseys

i still cant get it howto associate font to a new dialog without using rsrc.rc ;/
Uf, never been so hard to understand

Gunner

Quote from: caseys on December 31, 2010, 12:13:11 AM
i still cant get it howto associate font to a new dialog without using rsrc.rc ;/

Create a font with CreateFontIndirect and save the handle it returns
then in create a callback function

and in your WM_INITDIALOG
call EnumChildWindows with the address to your callback function

for example the callback I use:
SetControlFonts proc hWin:DWORD, lParam:DWORD
invoke SendMessage, hWin, WM_SETFONT, hFont, FALSE ; hfont is what was returned from CreateFontIndirect

mov eax, TRUE
ret
SetControlFonts endp


and in my WM_INITDIALOG I do:
invoke EnumChildWindows, hWin, addr SetControlFonts, NULL
~Rob (Gunner)
- IE Zone Editor
- Gunners File Type Editor
http://www.gunnerinc.com