Solved

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

Posted on 1998-04-27
4
173 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: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone 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

Suggested Solutions

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
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.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

856 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