|
-
Jun 24th, 2002, 10:25 AM
#1
Thread Starter
Addicted Member
events in controls
I made a dialog IDD_MY_DIALOG and associate procedure MY_DlgProc(....).
I have created a edit control IDC_EDIT1 and a button IDC_BUTTON1.
I can trap the clickevent of IDC_BUTTON in MY_DlgProc(....). as below
MY_DlgProc(....).
{
switch(msg)
{
case WM_CPMMAND:
switch(wParam)
{
case IDC_BUTTON1:
...........
}
}
}
Now How Can I trap the (EN_CHANGE) change event of IDC_EDIT1 in MY_DlgProc(....).
-
Jun 24th, 2002, 02:42 PM
#2
Fanatic Member
all you have to do is
switch(msg)
{
case WM_COMMAND:
switch(LOWORD(wParam)){
case THEBUTTON:
switch(HIWORD(wParam)){
case EN_CHANGE:
//do stuff
break
}
break
}
break
}
hope that helps

prog_tom
JOIN THE REVOLUTION!!!! Dual T3 backedup science community.
http://physics.sviesoft.com/forum
-
Jun 24th, 2002, 07:23 PM
#3
Thread Starter
Addicted Member
Thank U very much.It would be very greatful if U tell me when to use loword and when to use hiword.
-
Jun 24th, 2002, 07:30 PM
#4
Fanatic Member
Please don't thank me. I'm not all that good, afterall, I'm a 13 year old beginner. I still have to consult with other forum members on some questions, such Parksie and other guys.
Do you have AIM, or Yahoo Messenger?

prog_tom
JOIN THE REVOLUTION!!!! Dual T3 backedup science community.
http://physics.sviesoft.com/forum
-
Jun 24th, 2002, 09:09 PM
#5
PowerPoster
Originally posted by purusingh
Thank U very much.It would be very greatful if U tell me when to use loword and when to use hiword.
It's different for different messages. You can always consult MSDN for reference on a certain message. It'll tell you wether a message is stand-alone or it's sent through LPARAM or WPARAM parameters. It'll also tell you what type of information LOWORD and HIWORD of LPARAM and WPARAM have.
http://msdn.microsoft.com/library
-
Jun 25th, 2002, 09:42 AM
#6
Fanatic Member
nice website you got there, abdul.
I see, it's still a layout?
http://www.hinst.net/~tom/sckoolboyhumor/

prog_tom
JOIN THE REVOLUTION!!!! Dual T3 backedup science community.
http://physics.sviesoft.com/forum
-
Jun 26th, 2002, 09:38 AM
#7
Thread Starter
Addicted Member
I got how to trap EV_CHANGE.Not I want to trap after finishing typing into edit box and pressing enter(validate event in vb).
-
Jul 10th, 2002, 05:52 PM
#8
BTW prog_tom, your code is faulty.
It should be:
Code:
switch(msg)
{
// ...
case WM_COMMAND:
switch(LOWORD(wParam))
{
case THEBUTTON:
// handle button commands, only realistic are BN_CLICKED and
// BN_DBLCLCK, those are often handled together
break;
case THEEDIT:
// since an edit control may send many messages, we should
// do a switch on the actual command too
switch(HIWORD(wParam))
{
case EN_CHANGE:
// ...
break;
}
break;
}
break;
}
In WM_COMMAND, the arguments are used like this:
lParam = HWND of control
LOWORD(wParam) = ID of control
HIWORD(wParam) = actual command id
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|