hi all

yes, now i really need it, i know it request some kind of painting font.....
Anyway, avy example is appreciated.

B7
Posted on 2003-11-29 07:56:52 by Bit7
Use the customdraw feature.

Here's a sample (set text color only, but you may as well set the font)



.elseif ([edi].NMHDR.code == NM_CUSTOMDRAW)

.if ([edi].NMLVCUSTOMDRAW.nmcd.dwDrawStage == CDDS_PREPAINT)

invoke SetWindowLong, m_hWnd, DWL_MSGRESULT, CDRF_NOTIFYITEMDRAW
mov hr, 1

.elseif ([edi].NMLVCUSTOMDRAW.nmcd.dwDrawStage == CDDS_ITEMPREPAINT)

mov esi, [edi].NMLVCUSTOMDRAW.nmcd.lItemlParam
.if (!([esi].PropItem.wFlags & PROPITEM_FACTIVE))
;; invoke GetSysColor, COLOR_BTNFACE
mov eax, 0A7A7A7h
mov [edi].NMLVCUSTOMDRAW.clrText, eax
.endif


its code from a dlg proc (thats why this SetWindowLong is necessary) and hr is returncode placed in eax at last.

Japheth
Posted on 2003-11-29 18:10:38 by japheth
thanks japheth :)
Posted on 2003-11-30 06:55:39 by Bit7
Hi Bit7

Maybe this will help you too:



.data
qFont byte 'Arial Bold',0

.data?
lf LOGFONT <?> ; LOGFONT structure
hFontL dword ? ; font handle
hList dword ? ; handle of List View control

.code
...
invoke lstrcpy,addr lf.lfFaceName,addr qFont
mov lf.lfHeight,-12
mov lf.lfWeight,300
invoke CreateFontIndirect,addr lf
mov hFontL,eax
invoke SendMessage,hList,WM_SETFONT,hFontL,TRUE ; redraw itself
...


Check your API help file to check what members of structure LOGFONT are.
You can use this piece of code to send whatever font you want in any control (edit box, static, list box, etc.)

stanks
Posted on 2003-11-30 11:16:13 by stanks