Solved

Win32 edit control text change event

Posted on 2004-04-05
3
2,829 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Building cUrl in Windows v7.43.0 4 26
QAction use more than one time. 3 20
why "." vs "->" 23 116
best sources to up-to-date in C++? 8 56
When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
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++.

747 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

11 Experts available now in Live!

Get 1:1 Help Now