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
(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
It is not an algorithm problem... moved to main...
First parameter of the MessageBox function is a handle to the window. Try putting that ADDRwhatever on the second parameter.
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 ?
i have the total Font number but when i try to display this font, it display spaces :(
Somebody can help me ?
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
Look at the sample code here http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/fontext_7xpv.asp
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 !
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 !
Try:
Mirno
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
Try this app. :)
Tested on win2k only.
Tested on win2k only.
thanks a lot !! :alright:
My program is fully functionnal now :)
very big Thanks to you !
My program is fully functionnal now :)
very big Thanks to you !