Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. EN_CHANGE

EN_CHANGE

Scheduled Pinned Locked Moved C / C++ / MFC
helpc++delphijson
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    gamitech
    wrote on last edited by
    #1

    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. This is written in the MSDN. so i 've made a callback function in my w32 api for the dialog that contains the Edit Control like this: long FAR PASCAL fereastra1(HWND hdlg1,WORD wmessage1,WPARAM wparam1,LPARAM lparam1) { switch(wmessage1) { case WM_COMMAND: switch (wparam1) { case IDC_LIST1: switch(lparam1) { case 0x0300: MessageBox(NULL,"modified","HGabby",MB_OK); break; case EN_UPDATE: MessageBox(NULL,"modified","HGabby",MB_OK); break; } case IDOK: EndDialog(hdlg1,0); break; } break; } return 0; } can you tell me please how should I handle this problem When I do it in mfc it works. I mean each time I modifi the edit box a message box appears. I want to do it in a w32 api. so please help me thankx gabby

    A 2 Replies Last reply
    0
    • G gamitech

      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. This is written in the MSDN. so i 've made a callback function in my w32 api for the dialog that contains the Edit Control like this: long FAR PASCAL fereastra1(HWND hdlg1,WORD wmessage1,WPARAM wparam1,LPARAM lparam1) { switch(wmessage1) { case WM_COMMAND: switch (wparam1) { case IDC_LIST1: switch(lparam1) { case 0x0300: MessageBox(NULL,"modified","HGabby",MB_OK); break; case EN_UPDATE: MessageBox(NULL,"modified","HGabby",MB_OK); break; } case IDOK: EndDialog(hdlg1,0); break; } break; } return 0; } can you tell me please how should I handle this problem When I do it in mfc it works. I mean each time I modifi the edit box a message box appears. I want to do it in a w32 api. so please help me thankx gabby

      A Offline
      A Offline
      Andrzej Markowski
      wrote on last edited by
      #2

      Add one more break to your code. It should work now.

      long FAR PASCAL fereastra1(HWND hdlg1,WORD wmessage1,WPARAM wparam1,LPARAM lparam1)
      {

      switch(wmessage1)
      {
      case WM_COMMAND:
      {
      switch (wparam1)
      {
      case IDC_LIST1:
      {
      switch(lparam1)
      {
      case 0x0300:
      MessageBox(NULL,"modified","HGabby",MB_OK);
      break;
      case EN_UPDATE:
      MessageBox(NULL,"modified","HGabby",MB_OK);
      break;
      }
      }
      break; // missed break
      case IDOK:
      EndDialog(hdlg1,0);
      break;
      }
      break;
      }
      return 0;
      }

      1 Reply Last reply
      0
      • G gamitech

        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. This is written in the MSDN. so i 've made a callback function in my w32 api for the dialog that contains the Edit Control like this: long FAR PASCAL fereastra1(HWND hdlg1,WORD wmessage1,WPARAM wparam1,LPARAM lparam1) { switch(wmessage1) { case WM_COMMAND: switch (wparam1) { case IDC_LIST1: switch(lparam1) { case 0x0300: MessageBox(NULL,"modified","HGabby",MB_OK); break; case EN_UPDATE: MessageBox(NULL,"modified","HGabby",MB_OK); break; } case IDOK: EndDialog(hdlg1,0); break; } break; } return 0; } can you tell me please how should I handle this problem When I do it in mfc it works. I mean each time I modifi the edit box a message box appears. I want to do it in a w32 api. so please help me thankx gabby

        A Offline
        A Offline
        Andrzej Markowski
        wrote on last edited by
        #3

        This is a working code:

        LRESULT CALLBACK wndproc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
        {
        switch (message)
        {
        case WM_COMMAND:
        // (HWND) lParam - handle of control
        // LOWORD(wParam) - item, control, or accelerator identifier
        // HIWORD(wParam) - notification code

        if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL)
        {
        EndDialog(hDlg, LOWORD(wParam));
        return TRUE;
        }
        else if(LOWORD(wParam) == IDC_EDIT1)
        {
        switch(HIWORD(wParam))
        {
        case EN_CHANGE:
        MessageBox(NULL,"EN_CHANGE","Edit Notify",MB_OK);
        return TRUE;
        case EN_UPDATE:
        MessageBox(NULL,"EN_UPDATE","Edit Notify",MB_OK);
        return TRUE;
        }
        }
        break;
        }
        return FALSE;
        }

        ____________________ A.M.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups