void CMainScreen::OnTimer(UINT_PTR nIDEvent)
{
	switch( nIDEvent) {
	case 8888 : // TS2019 1220
		KillTimer( 8888);
		EraseLastCursor();
		break;
	}//switch

	CStatic::OnTimer(nIDEvent);
}


// TS2019 1220
void CMainScreen::VVOnMouseMove(UINT nFlags, CPoint point)
{
	CDC *pdc = GetDC();
	CRect rct;
	CPen pen, *op = NULL;

	GetClientRect( &rct);
	pen.CreatePen( PS_SOLID, 1, RGB(255,255,255));
	pdc->SetROP2( R2_XORPEN);
	op = pdc->SelectObject( &pen);

	if( m_oPoint.x == -1 && m_oPoint.y == -1) {
	} else if( rct.PtInRect( point) ) {
		pdc->MoveTo( m_oPoint.x, rct.top);
		pdc->LineTo( m_oPoint.x, rct.bottom);
		pdc->MoveTo( rct.left,  m_oPoint.y);
		pdc->LineTo( rct.right, m_oPoint.y);
	} else {
	}//if
	pdc->MoveTo( point.x, rct.top);
	pdc->LineTo( point.x, rct.bottom);
	pdc->MoveTo( rct.left,  point.y);
	pdc->LineTo( rct.right, point.y);
	pdc->SelectObject( op);
	ReleaseDC( pdc);

	m_oPoint =  point;
	SetTimer( 8888, 100, NULL); // 영역밖으로 벗어날때 커서 지우기

	CStatic::OnMouseMove(nFlags, point);
}

// TS2019 1220
void CMainScreen::EraseLastCursor()
{
	CRect rct;
	CPoint cu;
    
    SetCapture();
	GetCursorPos( &cu);
	ScreenToClient( &cu);
	ReleaseCapture();
	GetClientRect( &rct);
    
	if( rct.PtInRect( cu) == FALSE) {
		CDC *pdc = GetDC();
		CPen pen, *op = NULL;
		pdc->SetROP2( R2_XORPEN);
		pen.CreatePen( PS_SOLID, 1, RGB(255,255,255));
		op = pdc->SelectObject( &pen);
		pdc->MoveTo( m_oPoint.x, rct.top);
		pdc->LineTo( m_oPoint.x, rct.bottom);
		pdc->MoveTo( rct.left,  m_oPoint.y);
		pdc->LineTo( rct.right, m_oPoint.y);
		pdc->SelectObject( op);
		ReleaseDC( pdc);
		m_oPoint = CPoint( -1, -1);
	} else {		
		SetTimer( 8888, 100, NULL); // 영역밖으로 벗어날때 커서 지우기 확인 사살
	}//if
}

+ Recent posts