flat assembler
Message board for the users of flat assembler.
Index
> Windows > Edit item properties |
Author |
|
AsmGuru62 12 Mar 2014, 18:21
You need to respond to EN_CHANGE notification in your dialog box procedure.
I do not see however, how will you make it back to visible? Because once it is invisible - you cannot edit it. |
|||
12 Mar 2014, 18:21 |
|
Doug Herr 12 Mar 2014, 18:26
A separate checkbox determines whether the edit item is needed or not,
i.e., checkbox checked -> edit item invisible and editing not necessary checkbox not checked -> edit item visible & editable |
|||
12 Mar 2014, 18:26 |
|
Doug Herr 12 Mar 2014, 20:21
I'm guessing there's a message I can send (SendMessage) that will make the item visible or invisible, but what message and with what parameters? A few hours searching MSDN did nothing but cure insomnia.
|
|||
12 Mar 2014, 20:21 |
|
baldr 12 Mar 2014, 20:38
Doug Herr,
Try setting window style of that control (beware of making current control invisible). Disabling works the same way. |
|||
12 Mar 2014, 20:38 |
|
JohnFound 12 Mar 2014, 20:58
Code: invoke ShowWindow, [.win_handle], SW_SHOWNORMAL invoke ShowWindow, [.win_handle], SW_HIDE ; You can find the dialog box control handle by calling: invoke GetDlgItem, [.dialog_handle], .control_ID |
|||
12 Mar 2014, 20:58 |
|
Doug Herr 12 Mar 2014, 21:08
JohnFound wrote:
Nope, the edit item and the checkbox are in the same dialog box baldr wrote: Doug Herr, Can you show me an example? Or do I need to destroy the entire dialog box & re-display with or without the edit item? |
|||
12 Mar 2014, 21:08 |
|
JohnFound 12 Mar 2014, 21:30
1. Process the WM_COMMAND message of the dialog box. You will get one for every click on the check box. Identify the check box by the control ID, passed in the low word of .wparam.
2. If the click is on the check box, read the check box state by sending message BM_GETCHECK. Invert it and use BM_SETCHECK to set the new state of the checkbox. 3. Get the edit box handle by "invoke GetDlgItem, [.dlg], idEdit" - the result handle is in EAX. 4. If the checkbox is checked, call: "invoke ShowWindow, eax, SW_SHOWNORMAL". If not: "invoke ShowWindow, eax, SW_HIDE". 5. that is all... Similar code, used in one of my programs (it enables/disables the edit control insted of hiding/showing, but the idea should be clear): Code: .wm_command: cmp word [.wparam], idAutoHideCheck ; the checkbox ID is idAutoHideCheck jne .ondefault cmp word [.wparam+2], BN_CLICKED ; the checkbox has been clicked. jne .ondefault invoke SendDlgItemMessageA, [.hwnd], idAutoHideCheck, BM_GETCHECK, 0, 0 mov ebx, eax xor ebx, 1 invoke SendDlgItemMessageA, [.hwnd], idAutoHideCheck, BM_SETCHECK, ebx, 0 invoke GetDlgItem, [.hwnd], idAutoHideTime ; idAutoHideTime is the ID of the edit control. invoke EnableWindow, eax, ebx |
|||
12 Mar 2014, 21:30 |
|
Doug Herr 12 Mar 2014, 21:42
Thanks JohnFound, I'll give that a try.
EDIT: I got it working & it's just what I wanted, thanks again. |
|||
12 Mar 2014, 21:42 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.