Click to See Complete Forum and Search --> : Cursor leaving window


Laurent++
April 22nd, 1999, 04:12 AM
How do i know when my cursor has left a window client rect (without tricks)
like in tooltips ?

Clive Walker
April 22nd, 1999, 04:28 AM
Hello

Something like the following code in your CView::OnMouseMove handler.

ClientToScreen ( &point );
GetClientRect ( &rcClient );
ClientToScreen ( &rcClient );
if ( rcClient.PtInRect(point) )
{
// cursor within window
SetCapture();
}
else {
// cursor outside window
ReleaseCapture();
}

Hope that helps or gives you some ideas...