Write a VC++ Window Program to Display the Characters entered by User from the Keyboard and type five to six Lines also take care of backspace is work.

Add

#define ID_EDIT 1


LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
int wmId, wmEvent;
PAINTSTRUCT ps;
HDC hdc;

static HWND hwndEdit;

switch (message)
{
case WM_CREATE:
hwndEdit=CreateWindow(TEXT("edit"),NULL,WS_CHILD|WS_CHILD|WS_VISIBLE|WS_HSCROLL|WS_VSCROLL|WS_BORDER|ES_LEFT|ES_MULTILINE|ES_AUTOHSCROLL|ES_AUTOVSCROLL,0,0,0,0,hWnd,(HMENU)ID_EDIT,((LPCREATESTRUCT)lParam)->hInstance,NULL);
break;
case WM_SETFOCUS:
SetFocus(hwndEdit);
break;
case WM_SIZE:
MoveWindow(hwndEdit,0,0,LOWORD(lParam),HIWORD(lParam),TRUE);
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