no replyes huh? Oh well this is what I think, tell me if I am close......
Code:
case WM_LBUTTONDOWN:
{
//extract x and y from lparam
int x=LOWORD(lParam);
int y=HIWORD(lParam);
//borrow the main window's DC
HDC hdc=GetDC(hWndMain);
//moves from here to
//update the CP
///here?
MoveToEx(hdc,x,y,NULL);
//return the dc to the system
ReleaseDC(hWndMain,hdc);
//handled, return 0
return(0);
}break;
case WM_MOUSEMOVE:
{
//if left button is down
if(wParam & MK_LBUTTON)
{
//extract x and y from lparam
int x=LOWORD(lParam);
int y=HIWORD(lParam);
//borrow the main window's DC
HDC hdc=GetDC(hWndMain);
//line to the x,y position
LineTo(hdc,x,y);
//here and then switches back when you're not
//moving it to.......
//return the dc to the system
ReleaseDC(hWndMain,hdc);
}