flat assembler
Message board for the users of flat assembler.
Index
> Windows > setting font |
Author |
|
VitalOne 08 Apr 2004, 05:10
I haven't tested this, but try this:
Code: wmcreate: invoke CreateWindowEx,WS_EX_CLIENTEDGE,_lb,0,WS_VISIBLE+WS_CHILD+LBS_STANDARD,5,5,110,75,[hwnd],0,[hinstance],NULL or eax,eax jz failed mov [lbhwnd],eax invoke CreateWindowEx,0,_btn,_btn_text,WS_VISIBLE+WS_CHILD+BS_PUSHBUTTON,5,85,55,20,[hwnd],0,[hinstance],NULL or eax,eax jz failed mov [btnhwnd],eax invoke CreateFont,16,0,0,0,0,FALSE,FALSE,FALSE,ANSI_CHARSET,OUT_RASTER_PRECIS,CLIP_DEFAULT_PRECIS,DEFAULT_QUALITY,FIXED_PITCH+FF_DONTCARE,NULL or eax,eax jz failed mov [childfont],eax invoke SendMessage,[lbhwnd],WM_SETFONT,[childfont],FALSE invoke SendMessage,[btnhwnd],WM_SETFONT,[childfont],FALSE xor eax,eax jmp finish failed: or eax,-1 jmp finish |
|||
08 Apr 2004, 05:10 |
|
coconut 08 Apr 2004, 21:13
changed it, still crashes at the same point.. strange the same code works in the MiniPad example. could it be the type of controls im trying to work with dont support the font being created?
|
|||
08 Apr 2004, 21:13 |
|
comrade 08 Apr 2004, 21:18
Maybe its because last parameter of CreateFont is zero? needs to point to asciiz string
|
|||
08 Apr 2004, 21:18 |
|
zenek_tm 08 Apr 2004, 22:31
The last parameter must be a pointer to a string with font name.
|
|||
08 Apr 2004, 22:31 |
|
coconut 08 Apr 2004, 23:29
how would i send a pointer to
_font db 'Times New Roman',0 is that like using ADDR in masm? |
|||
08 Apr 2004, 23:29 |
|
comrade 09 Apr 2004, 03:02
just write _font
|
|||
09 Apr 2004, 03:02 |
|
coconut 10 Apr 2004, 05:37
Code: _sfont db "Times New Roman",0 invoke CreateFont,13,0,0,0,0,0,0,0,0,0,0,0,0,_sfont works - thanks |
|||
10 Apr 2004, 05:37 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.