News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Detect <ENTER> in dialog EDIT control

Started by mariø, March 10, 2005, 09:30:09 AM

Previous topic - Next topic

mariø

What is the message I have to proccess in DialogProc to detect an <ENTER> in a EDIT control?


petezl

VK_RETURN will trap the enter key but if the edit control has focus and the ES_MULTILINE style then you don't need it, The enter key will create a new line.
Peter.
Cats and women do as they please
Dogs and men should realise it.

mariø

I need to do something when the user press <enter> in a single line EDIT control.
I haven't receive VK_RETURN messages in the dialog proc (note that I use the dialog as a main window, created with:
Invoke DialogBoxParam, eax, IDD_SMS, NULL, Addr DialogProc, NULL )

petezl

If focus was on say a button in a dialog proc then enter would be the equivalent of pushing it. If the focus was on a single line edit control (without actually testing it) I should imagine that nothing would happen!
You could trap the enter Key with something like:
.elseif uMsg==WM_KEYDOWN
mov eax, wParam
.if eax==VK_RETURN
invoke SendMessage, do something

But that would probably mess with the tab system that is controlled by windows in a dialog proc.
You might have to find out first whether the focus is set to that particular edit control.

Peter.
Cats and women do as they please
Dogs and men should realise it.

AeroASM

I think you have to subclass it; look up Iczelion's tutorial.

mariø

Quote from: AeroASM on March 10, 2005, 02:08:50 PM
I think you have to subclass it; look up Iczelion's tutorial.

thanks AeroASM, Tutorial 22: Superclassing is where I need