Write a Window Program to Display the Character Enter By user from the Keyboard.[consider only alphabets and numbers only] 


Add #include"stdio.h"
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

Popular posts from this blog

Uploading Image to Sql Server Image Datatype in asp.net using fileupload Control

Get Running Sum of Query SQL Query