I have created a program which has one main window. and inside its WndProc's WM_CREATE section I create two edit windows using CreateWindow() both have the parent same window (the original window).
Now I want to handle the KeyPress event differently for the one edit Box.
So I used following code to set the different Prc for one edit Window
}
break;
case WM_CREATE:
SetWindowLong(txtsnd,GWL_WNDPROC,(LONG) SndWndProc);
break;
case WM_COMMAND :
{
MessageBox(NULL,TEXT("WM_COMMAND"), TEXT("WM_CMD!!"),MB_OK);
switch(LOWORD(wParam))
{
case WM_KEYUP:
MessageBox(NULL,TEXT("KEY UP"), TEXT("UP!!!!"),MB_OK);
break;
case WM_KEYDOWN:
MessageBox(NULL,TEXT("KEY DOWN"), TEXT("DOWN!!!!"),MB_OK);
break;
}
}
break;
default:
return WndProc(hwnd,msg,wParam,lParam);
}
return 0;
}
LRESULT CALLBACK WndProc(HWND hwnd,UINT msg, WPARAM wParam, LPARAM lParam)
{
// the code for WndProc
}
//// This results to the following error
error C3861: 'WndProc': identifier not found
// Now if I change the default section of the switch
return DefWindowProc(hwnd,msg,wParam,lParam);
the build succeeds .... but the program still doesnt work....
I just want to send the text in the edit box to some remote side whenever the user presses enter while typing. I have a default button but it loses focus as user starts typing something...
can anyone help me out of this ? any tutorial, book, maiterial on WIN 32 API will be of great help. I just want to learn all this heck.