WORD xPos, yPos;
case WM_LBUTTONDOWN:
{
HDC hdc;
WORD nSize, xPos_new, yPos_new;
TCHAR szBuf[80];
DWORD dw;
HANDLE File;
RECT rc;
GetClientRect (hWnd, &rc); // client window size
const int xW = rc.right;
const int yW = rc.bottom;
//Отображение координат клика на окошке
xPos = LOWORD(lp);
yPos = HIWORD(lp);
hdc = GetDC(hWnd);
if (xPos > 0 & yPos > 0 & xPos < xW & yPos < yW)
{
HDC hDC;
hDC=BeginPaint(hWnd, &ps);
hDC=GetDC(hWnd);
HBRUSH hBrush;
hBrush=CreateSolidBrush(RGB(255,0,0));
SelectObject(hDC,hBrush);
Ellipse(hDC, xPos - 4, yPos - 4, xPos + 4, yPos + 4);
MoveToEx(hDC, 20, yW / 2, NULL);
LineTo(hDC, xPos, yPos);
MoveToEx(hDC, xPos, yPos, NULL);
xPos_new = LOWORD(lp);
yPos_new = HIWORD(lp);
LineTo(hDC, xPos_new, yPos_new);
EndPaint(hWnd, &ps);
}
}