如题.

解决方案 »

  1.   

    ClipCursorSee Also
    GetClipCursor, GetCursorPos, GetLastError, SetCursorPos, RECTRequirements
    Runs on Versions Defined in Include Link to 
    Windows CE OS 1.0 and later Winuser.h   Cursor.lib, Mcursor.lib 
    This function confines the cursor to a rectangular area on the screen. If a subsequent cursor position (set by the SetCursorPos function or the mouse) lies outside the rectangle, Windows CE automatically adjusts the cursor position to keep it inside the rectangular area. BOOL ClipCursor( 
    CONST RECT *lpRect
    ); 
      

  2.   

    CRect rt;
    ClipCursor(&rt);//限制一个范围
    ClipCursor(NULL);//解除限制
      

  3.   

    CWnd *pWnd = GetDlgItem(IDC_LIMIT);//获取要限定的区域
                                  //其中IDC_LIMIT是你要限定鼠标的区域
    CRect rect;
    pWnd->GetWindowRect(&rect);
    ClipCursor(&rect);//限定区域