Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 183
  • Last Modified:

How to be notified when user change focus to another dialog item?

I need to update the values on an edit box whenever the user finishes editing, which means that the cursor should be at another position. So how am I to be notified about it so as to update the values.
0
exx
Asked:
exx
  • 2
1 Solution
 
chensuCommented:
Derive your own edit box class from CEdit and override the message handler OnKillFocus(). In the dialog box's OnInitDialog(), call SubclassDlgItem() to subclass the edit box.
0
 
chensuCommented:
Any comments?
0
 
piano_boxerCommented:
A better (easier) way would be to handle the EN_KILLFOCUS notification that the edit control sends to its parent. The notification is sendt via the WM_COMMAND message:

EN_KILLFOCUS
idEditCtrl = (int) LOWORD(wParam); // identifier of edit control
wNotifyCode = HIWORD(wParam);      // notification code
hwndEditCtrl = (HWND) lParam;      // handle of edit control


This way you dont have to do any subclassing.
0
 
exxAuthor Commented:
Actually found the answer before you, but never mind.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now