Code:
case WM_PAINT:
hdc = BeginPaint(hWnd, &ps);
MoveToEx(hdc,0,0,NULL);
LineTo(hdc,639,429);
MoveToEx(hdc,300,0,NULL);
LineTo(hdc,50,300);
TextOut(hdc,120,30,"<- a few lines ->",17);
Ellipse(hdc,250,250,450,450);
TextOut(hdc,345,330,"Ellipse",7);
Chord(hdc,550,20,630,80,555,25,625,70);
TextOut(hdc,470,30," A Chord ->",11);
Pie(hdc,300,50,400,150,300,50,300,100);
TextOut(hdc,350,80,"<- A Pie Wedge", 14);
Rectangle(hdc,550,300,700,400);
TextOut(hdc,710,350,"<- A Rectangle",14);
Rectangle(hdc,x,y,x+50,y+50);
// TextOut(hdc,x+20,y,"X-",2);
// TextOut(hdc,x+35,y,convertedX,(int)strlen(convertedX));
// TextOut(hdc,x+20,y+20,"Y-",2);
// TextOut(hdc,x+35,y+20,convertedY,(int)strlen(convertedY));
ValidateRect(hWnd,NULL);
EndPaint(hWnd,&ps);
break;
case WM_MOUSEMOVE:
x=LOWORD(lParam);
y=HIWORD(lParam);
itoa(x,convertedX,10);
itoa(y,convertedY,10);
// coords is of type RECT
coords.left = y;
coords.top = x;
coords.bottom = x+40;
coords.right = y+40;
InvalidateRect(hWnd,&coords,TRUE);
UpdateWindow(hWnd);
break;