edit: Someone helped me fix it already. I forgot to include gdi32
I am trying to use CreateFont so I can set the font of children in my window. This is what I use:
Now, when I try to run it, it gets this error on that line:
eq2.asm(171) : error A2006: undefined symbol : CreateFont
what's up with that?
I am trying to use CreateFont so I can set the font of children in my window. This is what I use:
invoke CreateFont,16,24,0,NULL,NULL,NULL,NULL,NULL,NULL,\
NULL,NULL,NULL,NULL, addr szFontName
Now, when I try to run it, it gets this error on that line:
eq2.asm(171) : error A2006: undefined symbol : CreateFont
what's up with that?
invokeCreateFont,100,30,0,0,FW_NORMAL,TRUE,1,0,OEM_CHARSET,\
OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS,\
9999,DEFAULT_PITCH or FF_DECORATIVE,\
ADDR FontName
invoke SelectObject, hdc, eax
mov hfont,eax
This works for me
You have a lot of NULLS in the creation data.
Some things have to be set.
Check the win32 help file
And dont forget to select the font into the device context.
OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS,\
9999,DEFAULT_PITCH or FF_DECORATIVE,\
ADDR FontName
invoke SelectObject, hdc, eax
mov hfont,eax
This works for me
You have a lot of NULLS in the creation data.
Some things have to be set.
Check the win32 help file
And dont forget to select the font into the device context.
The compiler can't find the declaration of CreateFont. Did you include gdi32.inc ?
Karim, yes, read the edit :P
titan, thanks, I did change those NULLs, but I'll try what you have.
titan, thanks, I did change those NULLs, but I'll try what you have.
Just one more question, How do i get the hDC?
I tried:
I tried:
invoke GetWindowDC, hwnd
Try to use GetDC or GetDCEx
Also you can get a dc by calling BeginPaint
It will be returned in eax
e.g.
invoke BeginPaint,hWnd,ADDR ps
mov hdc,eax
The tutorial for "Painting with text" should help if you have it.
Also you can get a dc by calling BeginPaint
It will be returned in eax
e.g.
invoke BeginPaint,hWnd,ADDR ps
mov hdc,eax
The tutorial for "Painting with text" should help if you have it.