Solved

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

Posted on 1998-04-27
4
169 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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Need a Shell script to start a service checking the port 6 47
bobThere java chalenge 45 82
sumDigits challenge 9 96
sameEnds challenge 3 106
In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
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…
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.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

708 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

18 Experts available now in Live!

Get 1:1 Help Now