I subclassed an edit box control like
lpfnOldWndProc = (FARPROC)SetWindowLong(hEdit,GWL_WNDPROC, (DWORD)SubClassFunc);
LRESULT FAR PASCAL SubClassFunc( HWND hWnd,
UINT Message,
WPARAM wParam,
LPARAM lParam)
{
switch(Message)
{
case WM_CHAR:
//Process this message to avoid message beeps.
if ((wParam == VK_RETURN) || (wParam == VK_TAB))
{
//Do Something
return 0;
}
break;
case WM_KEYDOWN:
if ((wParam == VK_RETURN) || (wParam == VK_TAB)) {
//Do Something
return 0;
}
break ;
default:
break;
}
return CallWindowProc((WNDPROC)lpfnOldWndProc, hWnd, Message, wParam, lParam);
}
Now when I enter char in editbox this subclassed procedure gets called. But I am not able to get it when enter key is pressed.
Is this something wrong in above procedure.