here is the question i wish to solve in here!!! The questions is like that!!Create a line editor where the delete and backspace keys function perfectly.here is the code i put in here.the code is working perfectly with the left and right keys. the only problem
is the delete and backspace keys.Actually,it's used caret to creat it.u will understand after see my coding. i just wanna to do like this. when i press the delete button it will delete the character and when i pressed the backspace keys it also delete the characters.i just wanna to see the cursor moving when i pressed the delete nor the backspace button. THANKS!!!

where should i put the part of these two coding my program?
and how the coding should look like? pls help me!!! urgent!!!!
i want these two function keys works perfectly. THANKS!!!






#include<windows.h>

long FAR PASCAL WndProc(HWND ,UINT, WPARAM,LPARAM);

int PASCAL WinMain(HANDLE hInst,HANDLE hPrevInstance,LPSTR lpszCmdLine,int nCmdShow)
{
HWND hWnd;
MSG msg;
WNDCLASS wndclass;



if(!hPrevInstance)
{
wndclass.style=0;
wndclass.lpfnWndProc=(WNDPROC)WndProc;
wndclass.cbClsExtra=0;
wndclass.cbWndExtra=0;
wndclass.hInstance=hInst;
wndclass.hIcon=LoadIcon(hInst,IDI_APPLICATION);
wndclass.hCursor=LoadCursor(NULL,IDC_ARROW);
wndclass.hbrBackground=GetStockObject(WHITE_BRUSH) ;
wndclass.lpszMenuName=MAKEINTRESOURCE(NULL);
wndclass.lpszClassName="MyClass";
if(!RegisterClass(&wndclass))
return 0;
}
hWnd=CreateWindow("MyClass","Student Pre-App Form",WS_OVERLAPPEDWINDOW,10,10,300,300,NULL,NULL, hInst,NULL);
ShowWindow(hWnd,nCmdShow);

while(GetMessage(&msg,0,0,0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return(msg.wParam);
}

long FAR PASCAL WndProc(HWND hWnd ,UINT wMessage,WPARAM wParam,LPARAM lParam)

{
POINT pt;
TEXTMETRIC tm;
HDC hdc;
static int nwidth,nheight;
switch(wMessage)
{
case WM_CREATE:
CreateCaret(hWnd,NULL,10,10);
ShowCaret(hWnd);
SetCaretPos(0,0);
hdc=GetDC(hWnd);
GetTextMetrics(hdc,&tm);
ReleaseDC(hWnd,hdc);
nwidth=tm.tmAveCharWidth;
nheight=tm.tmHeight;
break;
case WM_KEYDOWN:
GetCaretPos(&pt);
switch(wParam)
{
case VK_LEFT:
pt.x-=nwidth;
break;
case VK_RIGHT:
pt.x+=nwidth;
break;
case VK_UP:
pt.y-=nheight;
break;
case VK_DOWN:
pt.y+=nheight;
break;
}
SetCaretPos(pt.x,pt.y);
break;

case WM_DESTROY:
DestroyCaret();
PostQuitMessage(0);
break;
default:
return DefWindowProc(hWnd,wMessage,wParam,lParam);
}
return 0L;
}




pls help with this!!! pls show me the code !!!!
i will be waiting for urs reply!! THANKS!!!