我在对话框的OnInitDialog()里用了AfxGetApp()->LoadStandardCursor(IDC_CROSS),可是鼠标形状没有变化!!!!!!!!请问怎么回事阿

解决方案 »

  1.   

    重载WM_SETCURSOR加入:
    SetCursor(AfxGetApp()->LoadStandardCursor(IDC_CROSS));
    return TRUE;
      

  2.   

    我刚刚做过一个
    这样:
    private:
    HCURSOR m_hButtonCursor;BOOL CDragonDlg::OnInitDialog()
    {
     ............
    m_hButtonCursor = AfxGetApp()->LoadCursor(IDC_MYHAND);
    ...........
    }BOOL CDragonDlg::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message) 
    {
    // TODO: Add your message handler code here and/or call default
        CString sClassName;
    ::GetClassName(pWnd->GetSafeHwnd(),sClassName.GetBuffer(80),80);
    if(sClassName=="Button" && m_hButtonCursor)
    {
    ::SetCursor(m_hButtonCursor);
    return TRUE;
    }
    return CDialog::OnSetCursor(pWnd, nHitTest, message);
    }
      

  3.   

    btw:我这个是让鼠标移动到按钮上时变成别的形状
      

  4.   

    重载WM_SETCURSORBOOL CXXXDlg::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message)
    {
        SetCursor(AfxGetApp()->LoadStandardCursor(IDC_CROSS));
        return TRUE;
       // return CDialog::OnSetCursor(pWnd, nHitTest, message); 
       //去掉上面的
    }
      

  5.   

    怎么调用OnsetCursor(....)?
    点击一个按钮进行运算,刚开始设置鼠标形状为IDC_WAIT,运行结束恢复原装,可是怎么来调用这个函数阿?几个参数是什么意思?顺便问一下,什么时候可以激发这个OnSetCursor事件?