Thread: Edit Boxes

  1. #1
    Registered User
    Join Date
    Nov 2002
    Posts
    30

    Question Edit Boxes

    I have an edit box that is a child to a simple window. I created it with CreateWindow(). I want to be notified when something is typed into the edit box. I tried using WM_CHAR and WM_KEYDOWN in my wndproc but it didn't work. Does anyone know how i could go about doing this?
    Thx.
    Last edited by bc17; 02-15-2003 at 01:16 PM.

  2. #2
    Registered User sean345's Avatar
    Join Date
    Mar 2002
    Posts
    346
    You could either continue checking the message box and see if anything has been added or changed or you could subclass the edit control and intercept any messages about a charecter being typed.

    - Sean
    If cities were built like software is built, the first woodpecker to come along would level civilization.
    Black Frog Studios

  3. #3
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    Posts
    4,829
    Subclass it. Here is an example I wrote for someone else, shows the technique...
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

  4. #4
    Registered User
    Join Date
    Nov 2002
    Posts
    30
    Thx a lot for this example. I got it to work now.

  5. #5
    Registered User
    Join Date
    Nov 2002
    Posts
    157
    isn't there just a message that the window receives when somebody types into its edit child?

  6. #6
    pear shaped
    Guest
    Code:
    case WM_COMMAND:
    	if ( (HWND)lParam == hEdit ) {
    		switch( HIWORD(wParam) ) {
    			case EN_CHANGE:
    				hEdit has changed
    		}
    	}

  7. #7
    Registered User
    Join Date
    Nov 2002
    Posts
    157
    Originally posted by pear shaped
    Code:
    case WM_COMMAND:
    	if ( (HWND)lParam == hEdit ) {
    		switch( HIWORD(wParam) ) {
    			case EN_CHANGE:
    				hEdit has changed
    		}
    	}
    okay, i figured there was a message you could just use. thanks.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. WS_HSCROLL in ES_READONLY edit box error
    By Homunculus in forum Windows Programming
    Replies: 4
    Last Post: 02-13-2006, 08:46 AM
  2. Edit box(es), and specialized onmouseover
    By Lurker in forum Windows Programming
    Replies: 7
    Last Post: 05-25-2003, 04:13 PM
  3. Edit Boxes
    By ColdFire in forum Windows Programming
    Replies: 2
    Last Post: 02-13-2002, 02:54 PM
  4. please help visual c++ edit control boxes
    By alcoholic in forum C++ Programming
    Replies: 3
    Last Post: 02-05-2002, 02:39 PM
  5. Password Edit Boxes
    By Unregistered in forum Windows Programming
    Replies: 1
    Last Post: 08-27-2001, 02:40 PM