Solved

Win32 edit control text change event

Posted on 2004-04-05
3
3,221 Views
Last Modified: 2008-02-01
I'm new to Win32, how do I catch a text change event for an edit control in WndProc?
0
Comment
Question by:jd9288
  • 2
3 Comments
 
LVL 16

Accepted Solution

by:
nonubik earned 25 total points
ID: 10757475
It's EN_CHANGE notification message that comes with WM_COMMAND

like:

switch(uMsg)
{
  case WM_COMMAND:
   if((HIWORD(wParam) == EN_CHANGE) && //notification
     (LOWORD(wParam) == MY_IDC_EDIT))   //your edit control ID
   {
     ....
    }
    break;
}
0
 
LVL 48

Assisted Solution

by:AlexFM
AlexFM earned 25 total points
ID: 10757485
EN_CHANGE
The EN_CHANGE notification message is sent when the user has taken an action that may have altered text in an edit control. Unlike the EN_UPDATE notification message, this notification message is sent after the system updates the screen. The parent window of the edit control receives this notification message through a WM_COMMAND message.

LRESULT CALLBACK WindowProc(
  HWND hwnd,       // handle to window
  UINT uMsg,       // WM_COMMAND
  WPARAM wParam,   // edit control identifier, EN_CHANGE
  LPARAM lParam    // handle to edit control (HWND)
);
Parameters
wParam
The low-order word specifies the edit control identifier.
The high-order word specifies the notification message.

lParam
Handle to the edit control.
0
 
LVL 16

Expert Comment

by:nonubik
ID: 10757493
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

808 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