Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 1998-04-27
4
Medium Priority
?
179 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
Ready to get certified? Check out some courses that help you prepare for third-party exams.
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.
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…

972 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