CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 1999
    Posts
    3

    Cursor leaving window

    How do i know when my cursor has left a window client rect (without tricks)
    like in tooltips ?


  2. #2
    Join Date
    Apr 1999
    Location
    Nottingham, UK
    Posts
    35

    Re: Cursor leaving window

    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...


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured