-
Getting a change message
I'd like to do "instant calculating" (when user edits a Edit control, the program automaticly changes another Edit control). I know how to read and how to write in a Edit control, but I don't know which message carries an information about changing Edit fields?
Thanks for help!
-
-
To expand on anonytmouse's answer you will need something like this in your main window's callback function.
Code:
switch(message)
{
case (WM_COMMAND) :
{
if (LOWORD(wParam) == ID_OF_EDIT_CONTROL)
{
if (HIWORD(wParam) == EN_CHANGE)
{
//Your edit control was just changed
}
}
break;
}
}
Any messages from a child windo to the parent in a WM_COMMAND message. wParam holds the ID of the control that sent the message in its low order bits. And the message that was sent in its high order bits. The macros LOWORD() and HIWORD() retrieve the low and high order bits from an integer. You can switch thise if statements into switch's if you intend to get additional child window messages.
-
To be certain the notification was fired for a control, you'll want to ensure the lParam of the WM_COMMAND is non-NULL, too. :)