Solved

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

Posted on 1998-04-27
4
170 Views
Last Modified: 2013-11-19
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
Comment
Question by:exx
  • 2
4 Comments
 
LVL 23

Expert Comment

by:chensu
ID: 1303005
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
 
LVL 23

Expert Comment

by:chensu
ID: 1303006
Any comments?
0
 
LVL 4

Accepted Solution

by:
piano_boxer earned 100 total points
ID: 1303007
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
 

Author Comment

by:exx
ID: 1303008
Actually found the answer before you, but never mind.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
VB.NET how to use the Vertical ScrollBar 5 90
repeatEnd java challenge 42 84
Tab names are off by one 5 53
format the code in java 6 86
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now