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

x
?
Solved

Win32 edit control text change event

Posted on 2004-04-05
3
Medium Priority
?
4,100 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 100 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 100 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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

What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
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 goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

783 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