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

invoke CreateFont,16,0,0,0,700,0,0,0,0,\
ADDR FontName
mov hFont,eax
invoke SendMessageA,hWnd_Button1,WM_SETFONT,\
hFont, NULL
invoke SendMessageA,hWnd_Button2,WM_SETFONT,\
hFont, NULL


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 ?.


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:


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:


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



invoke SendMessage, eax, WM_SETFONT, masterTileFont, FALSE

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


invoke SendMessageA,hWnd_Button1,WM_SETFONT, hFont, NULL
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