Лабораторная работа: Обчислення координат курсору миші при переміщенні
PAINTSTRUCT ps ;
RECT rect ;
RECT rectInv;
int x, y;
rectInv.top = 0;
rectInv.left = 0;
rectInv.right = 400;
rectInv.bottom = 60;
switch (iMsg)
{
case WM_CREATE :
return 0 ;
case WM_MOUSEMOVE:
cX = LOWORD(lParam);
cY = HIWORD(lParam);
InvalidateRect(hwnd, &rectInv, true);
return 0;
case WM_LBUTTONDOWN:
sX = LOWORD(lParam);
sY = HIWORD(lParam);
T1 = clock();
S = 0;
speed = 0;
wayOnTable = 0;
return 0;
case WM_RBUTTONDOWN:
x = LOWORD(lParam);
y = HIWORD(lParam);
S = sqrt((double)(( x - sX ) * ( x - sX ) + ( y - sY ) * ( y - sY)));