代码在CScrollView类中的WM_SETCURSOR
SetCursor(AfxGetApp()->LoadCursor(IDC_HAND));
结果到了热区却没有变为手形,这是什么原因呢?

解决方案 »

  1.   

    我的代码:
    BOOL CMpServerView::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message) 
    {
        int ret;
        ret=-1;
    if(MousePoint.x>0 && MousePoint.y>0)
    ret=PointToRect(MousePoint,0);
    if(ret>=0)
    {
            SetCursor(AfxGetApp()->LoadCursor(IDC_HAND));
    }
    else
    {
            SetCursor(AfxGetApp()->LoadStandardCursor(IDC_ARROW));
    }
    return CScrollView::OnSetCursor(pWnd, nHitTest, message);
    }
      

  2.   

    调用 SETCLASSLONG 来设置鼠标。
      

  3.   

    if(ret>=0)
    {
            SetCursor(AfxGetApp()->LoadCursor(IDC_HAND));
             AfxMessageBox("");   //看是不是执行了
    }