flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
Tyler Durden 20 Nov 2005, 08:18
Hi, I wrote tinny "noter"
![]() ![]() ![]() ![]() 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 |
|||
![]() |
|
Tyler Durden 20 Nov 2005, 10:38
Hi, sorry of the noobism of mine
![]() 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") |
|||
![]() |
|
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 |
|||
![]() |
|
Tyler Durden 20 Nov 2005, 12:32
Oh, thanks very much
![]() |
|||
![]() |
|
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. |
|||
![]() |
|
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 ![]() |
|||
![]() |
|
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 ![]() |
|||
![]() |
|
Tyler Durden 21 Nov 2005, 14:55
Tried this - doesn't work
![]() |
|||
![]() |
|
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. |
|||
![]() |
|
Tyler Durden 21 Nov 2005, 17:09
Here is the new code, all done as you said, but still doesn't work
![]() |
|||
![]() |
|
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 ![]() |
|||
![]() |
|
Tyler Durden 21 Nov 2005, 19:54
Ok, thanks for explaining
![]() |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.