flat assembler
Message board for the users of flat assembler.
Index
> Windows > Some questions 'bout changing window elements properties |
Author |
|
Tyler Durden 20 Nov 2005, 08:18
Hi, I wrote tinny "noter" too greet guys rooted by me It's also greets my sucky inet provider ICN But there're some things i want to change but don't know how
1. How to change background color and font in "edit" element ? 2. How to make this window to be "always on top" ? 3. How to make "edit" element unselectable ? 4. How to to select which element is "focused" when proggy starts ? Get all sources and exe here: http://www.tylerdurden.net.ru/icnsuxx.zip |
|||
20 Nov 2005, 08:18 |
|
Tyler Durden 20 Nov 2005, 10:38
Hi, sorry of the noobism of mine but
1. How to send message to control ? I try invoke PostMessage,[hwnddlg],WM_SETFONT,?,? <- where to put font handler and element id ? 2. Ok, thanks 3. Mine edit control allready ES_READONLY, i need that it can not be selected (i mean selection of the text) 4. Hm... How to set focus on element with that ? HWND SetFocus( HWND hWnd // handle of window to receive focus ); P.S. Btw, forgot to ask, where is "return" macro ? (i put "pop ebp" instead of it in the code, 'couse new fasm don't know what is "return") |
|||
20 Nov 2005, 10:38 |
|
decard 20 Nov 2005, 11:37
OK, now I understand that you created your dialog using CreateDialog or simiar API and you have to communicate with dialog item using their IDs.
So: 1. Code: invoke SendDlgItemMessage, [hwnddlg],ITEM_ID,WM_SETFONT,[hfont],TRUE or Code: invoke GetDlgItem, [hwnddlg],ITEM_ID invoke SendMessage, eax,WM_SETFONT,[hFont],TRUE 3. Proably you can't achive this with standard edit control, you have to subclass it (may be difficult) or handle EN_SELCHANGE notification (easier, but may not be what you actually want). 4. Code: invoke GetDlgItem, [hwnddlg],ITEM_ID invoke SetFocus, eax |
|||
20 Nov 2005, 11:37 |
|
Tyler Durden 20 Nov 2005, 12:32
Oh, thanks very much The last questions, in which way control messages arrive ? I mean, which event i mus handle for them ? WM_NOTIFY ? Or they arrive as-is (e.g. EM_SETSEL) ?
|
|||
20 Nov 2005, 12:32 |
|
decard 20 Nov 2005, 12:54
It is WM_NOTIFY message.
But, I looked at win32.hlp again, and it seems that EN_SELCHANGE applies only to RichEdit controls, so you can't use it with standard Edit. Anyway why do you need edit box with text that can't be selected? You can use static text instead. |
|||
20 Nov 2005, 12:54 |
|
Tyler Durden 20 Nov 2005, 13:05
Hm... Can't still get it 2 things ('ve tried almost all):
1. How to set color for edit control 2. How to kill focus from the button |
|||
20 Nov 2005, 13:05 |
|
Reverend 20 Nov 2005, 21:23
1 - Capture the WM_CTLCOLOREDIT message and return handle of brush with given color, eg.
Code: wm_ctlcoloredit: push 00FF0000h ; red call CreateSolidBrush ret 2 - SetFocus on something else |
|||
20 Nov 2005, 21:23 |
|
Tyler Durden 21 Nov 2005, 14:55
Tried this - doesn't work How to handle it's message ? Just like normal or as a part of WM_NOTIFY ?
|
|||
21 Nov 2005, 14:55 |
|
decard 21 Nov 2005, 15:14
it must be working
but you have to change 'call' to 'invoke' - CreateSolidBrush is an API call. It is normal message, not send via WM_NOTIFY. |
|||
21 Nov 2005, 15:14 |
|
Tyler Durden 21 Nov 2005, 17:09
Here is the new code, all done as you said, but still doesn't work
|
|||
21 Nov 2005, 17:09 |
|
decard 21 Nov 2005, 17:52
Checked it, and noticed that readonly edit controls don't send WM_CTLCOLOREDIT message, and are always grayed. Seems that subclassing is an only option
BTW funny program |
|||
21 Nov 2005, 17:52 |
|
Tyler Durden 21 Nov 2005, 19:54
Ok, thanks for explaining
|
|||
21 Nov 2005, 19:54 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.