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. 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
-
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
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;
} -
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
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.