I'm a new user in this board so i say Hello Everybody ! :)
(Excuse my very poor english :stupid: :grin: )

i'd like to enumerates all the fonts with the function 'EnumFontFamilies' but i have some problems with the PROC procedure :(

this is my code :

ComboBox_EnumFontFamProc proc lpelf:ENUMLOGFONT, lpntm:NEWTEXTMETRIC, FontType:DWORD, lParam:DWORD

invoke MessageBox, ADDR lpelf.elfFullName,0,0,0

mov eax,1
ret

ComboBox_EnumFontFamProc endp

but this code doesn't work. so i' have write this :

ComboBox_EnumFontFamProc proc lpelf:DWORD, lpntm:DWORD, FontType:DWORD, lParam:DWORD

invoke MessageBox,ADDR .elfFullName,0,0,0

mov eax,1
ret

ComboBox_EnumFontFamProc endp

this code display nothing !



PLEASE HELP !,

Thanks all
Posted on 2002-08-01 11:43:00 by kylekiller
It is not an algorithm problem... moved to main...
Posted on 2002-08-01 11:46:25 by JCP
First parameter of the MessageBox function is a handle to the window. Try putting that ADDRwhatever on the second parameter.
Posted on 2002-08-01 11:49:56 by stryker
Excuse me, i have ommited a parameter but this is not the problem

i have the total Font number but when i try to display this font, it display spaces :(

Somebody can help me ?
Posted on 2002-08-01 11:55:19 by kylekiller
Could you post a little more code. How did you call EnumFontFamilies?...

Look at the sample code here http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/fontext_7xpv.asp
Posted on 2002-08-01 12:06:47 by stryker
thanks for your help stryker :)

WndProc proc hWnd:HWND, uMsg:UINT, wParam:WPARAM, lParam:LPARAM

.IF uMsg == WM_CREATE
invoke GetDC, hWnd
mov hDC,eax
invoke EnumFontFamilies, hDC, 0, ADDR ComboBox_EnumFontFamProc, 0
invoke ReleaseDC, hWnd, hDC

.ELSEIF uMsg==WM_DESTROY
invoke PostQuitMessage,NULL
.ELSE
invoke DefWindowProc,hWnd,uMsg,wParam,lParam
ret
.ENDIF
xor eax,eax
ret
WndProc endp


thanks !
Posted on 2002-08-01 12:23:25 by kylekiller
Try:


ComboBox_EnumFontFamProc proc lpelf:DWORD, lpntm:DWORD, FontType:DWORD, lParam:DWORD
mov eax, lpelf
add eax, SIZEOF LOGFONT
invoke MessageBox, NULL, eax,0,0
mov eax,1
ret
ComboBox_EnumFontFamProc endp



Mirno
Posted on 2002-08-01 12:36:19 by Mirno
Try this app. :)

Tested on win2k only.
Posted on 2002-08-01 13:53:27 by stryker
thanks a lot !! :alright:

My program is fully functionnal now :)


very big Thanks to you !
Posted on 2002-08-01 13:54:01 by kylekiller