如题
怎样使得鼠标滑过按钮时改变光标

解决方案 »

  1.   

    SetClassLongPtr设置按钮类的光标,或者
    重载按钮,响应WM_SETCURSOR消息,设置自己的光标
      

  2.   


    响应WM_SETCURSOR消息
    BOOL CTestSETCURSORDlg::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message) 
    {
    // TODO: Add your message handler code here and/or call default
    switch(pWnd->GetDlgCtrlID())
        {
        case IDC_BUTTON1:
            SetCursor(::LoadCursor(NULL, IDC_HAND));
            break;
        default :
            SetCursor(::LoadCursor(NULL, IDC_ARROW));
        }
        
        return TRUE;// return CDialog::OnSetCursor(pWnd, nHitTest, message);
    }