flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
VitalOne
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 |
|||
![]() |
|
coconut
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?
|
|||
![]() |
|
comrade
Maybe its because last parameter of CreateFont is zero? needs to point to asciiz string
|
|||
![]() |
|
zenek_tm
The last parameter must be a pointer to a string with font name.
|
|||
![]() |
|
coconut
how would i send a pointer to
_font db 'Times New Roman',0 is that like using ADDR in masm? |
|||
![]() |
|
comrade
just write _font
|
|||
![]() |
|
coconut
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 |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.
Website powered by rwasa.