flat assembler
Message board for the users of flat assembler.
Index
> Windows > changing the font in edit control |
Author |
|
vbVeryBeginner 18 Jun 2006, 02:38
hi slai,
the hfont is a return value from CreateFontIndirect, if you don't want to use CreateFontIndirect, you could try GetStock ~ ANSI_FIXED_FONT, ANSI_VAR_FONT, SYSTEM_FONT ... to return stocked font handle. |
|||
18 Jun 2006, 02:38 |
|
Slai 18 Jun 2006, 05:40
thanks vbVeryBeginner, this is almost what I needed just I can't change the font to Terminal with it. After that I tryed :
Code: lf LOGFONTA 0,0,0,0,0,0,0,0,0,0,0,0,0,'Terminal' Code: invoke CreateFontIndirect, lf invoke SendMessage, [hEdit],WM_SETFONT,eax,1 |
|||
18 Jun 2006, 05:40 |
|
vbVeryBeginner 18 Jun 2006, 08:23
check it
for the muldiv, please reffer to http://board.flatassembler.net/topic.php?t=1933
|
|||||||||||
18 Jun 2006, 08:23 |
|
Slai 19 Jun 2006, 00:23
strange but the font isn't Terminal on my PC ..
I just want to put a DOS ascii font in the edit control, and as I know the only font that suports the DOS ascii is Terminal. Anyways, how can I change the font colour and the background colour in the edit control ? |
|||
19 Jun 2006, 00:23 |
|
Slai 21 Jun 2006, 17:53
I guess this question is too boring to get response
Anyway I found how to change the background and font colour from those examples : http://www.pbrennick.com/asmtools/Progress.zip (in MASM) Code: WM_CTLCOLOREDIT: invoke SetTextColor, [wParam], $ffff00 invoke SetBkColor, [wParam], 0 ; test background color (for all lines with text) invoke CreateSolidBrush, 0 ; background colour for the rest of the lines jmp finish |
|||
21 Jun 2006, 17:53 |
|
Slai 21 Jun 2006, 23:51
I noticed that in the exe file of a dialog made with fasm, there is a part in the recource section that is "MS Sans Serif" in Unicode. If I change that part to Terminal will this change the font in the edit control to Terminal, or that is used for something else ?
|
|||
21 Jun 2006, 23:51 |
|
Tomasz Grysztar 22 Jun 2006, 08:33
It will change the font used by all controls in that dialog box.
You can specify this parameter by giving tenth and eleventh parameter to the "dialog" macro, see Resource macros documentation. |
|||
22 Jun 2006, 08:33 |
|
Slai 23 Jun 2006, 02:06
that worked perfectly . Thanks!
I am planning to use this as a base of a compiler/editor that I am trying to do, so is it a bad idea to use dialog window for that instead of the normal way with CreateWindowEx ? Will the productivity/speed be less with dialog based window ? and another question off topic - why fasm doesn't recognise 'DialogBox' and 'CreateWindow' ? Aren't they functions of the library as their extended versions ? |
|||
23 Jun 2006, 02:06 |
|
madmatt 23 Jun 2006, 07:33
Is it possible to add bold typeface when changing the font?
|
|||
23 Jun 2006, 07:33 |
|
Vasilev Vjacheslav 25 Jun 2006, 19:25
<empty>
Last edited by Vasilev Vjacheslav on 27 Jun 2006, 11:04; edited 1 time in total |
|||
25 Jun 2006, 19:25 |
|
madmatt 26 Jun 2006, 17:13
Thanks Vasilev, But, didn't have any luck making it work. Anyways, I was hoping there would be a way using the resource macros. I'll keep trying different things until I get the effect i'm looking for.
MadMatt |
|||
26 Jun 2006, 17:13 |
|
Vasilev Vjacheslav 27 Jun 2006, 11:01
here is ported code:
Code: ; hWnd - handle of main window ; hId - id of control on main window proc _makebold hWnd,hId locals hmlf LOGFONT endl xor ebx,ebx invoke SendDlgItemMessage,[hWnd],[hId],WM_GETFONT,ebx,ebx lea edi,[hmlf] invoke GetObject,eax,sizeof.LOGFONT,edi test eax,eax jz @F mov [edi+LOGFONT.lfWeight],FW_BOLD mov [edi+LOGFONT.lfQuality],ANTIALIASED_QUALITY invoke CreateFontIndirect,edi invoke SendDlgItemMessage,[hWnd],[hId],WM_SETFONT,eax,1 @@: ret endp |
|||
27 Jun 2006, 11:01 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.