Write a Window Program to Display the Character Enter By user from the Keyboard.[consider only alphabets and numbers only]
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
int wmId, wmEvent;
PAINTSTRUCT ps;
HDC hdc;
char res[20];
static int i,j;
switch (message)
{
case WM_CHAR:
hdc=GetDC(hWnd);
sprintf(res,"%c",wParam);
TextOut(hdc,i,j,res,strlen(res));
break;
case WM_DESTROY:
PostQuitMessage(0);
break;
default:
return DefWindowProc(hWnd, message, wParam, lParam);
}
return 0;
}
Comments
Post a Comment