I change the Font of the Buttons and Statics with the CreateFont function:

.IF uMsg==WM_CREATE
invoke CreateFont,16,0,0,0,700,0,0,0,0,\
3,2,\
0,42h,\
ADDR FontName
mov hFont,eax
invoke SendMessageA,hWnd_Button1,WM_SETFONT,\
hFont, NULL
invoke SendMessageA,hWnd_Button2,WM_SETFONT,\
hFont, NULL

.ELSEIF uMsg==WM_COMMAND
....

It Work Fine in my Win98, but a friend test my program in his XP and the
Buttons appears with the Default Font.(The same for the Statics).

Can you tell my why ?.

Thanks.

The Morlok
Posted on 2002-04-16 15:39:37 by TheMorlok
Seeing you used hex instead of symbolic equates, i dont know what your doing when you create your font, so i will just give you the MSDN page and let you read it over:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/fontext_8fp0.asp

:alright:
NaN
Posted on 2002-04-17 01:55:33 by NaN
I will just comment on setting the font in STATIC windows. I have cut and pasted some code here, this is two ways to do it:

[size=12]

.ELSEIF uMsg == WM_CTLCOLORSTATIC
invoke GetDlgItem, m_hWnd, IDC_gameOverText
.IF eax == lParam
;select font into main "Game over" label
invoke SelectObject, wParam, masterTileFont

invoke SetBkMode, wParam, TRANSPARENT
RGB 255, 0, 0
invoke SetTextColor, wParam, eax
invoke GetStockObject, NULL_BRUSH

ret
.ENDIF
.ENDIF

-----------------------------------------------------------------------------------

invoke SendMessage, eax, WM_SETFONT, masterTileFont, FALSE
[/size]


Also, a pointer on coding style.... with your line:

[color=red]

invoke SendMessageA,hWnd_Button1,WM_SETFONT, hFont, NULL
[/color]
It is quite misleading to use NULL on the end, instead you should use FALSE. While they both evaluate to the same value, using FALSE is far more accurate for what that parameter is actually for (that parameter sets the redraw option).
Posted on 2002-04-17 06:42:14 by sluggy