响应WM_SETCURSOR
该消息是在WM_NCHITTEST后发出的。
当然,你必须先有图标资源。

解决方案 »

  1.   

    AfxGetApp()->LoadCursor(ResourceID)
      

  2.   

    BOOL CTestPronDlg::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message) 
    {
    // TODO: Add your message handler code here and/or call default
    HCURSOR newHCursor;
    CString str;
    LONG CursorID; ::GetClassName(pWnd->m_hWnd,str.GetBuffer(80),80);
    if (str.Compare("Button"))
    {
    return CDialog::OnSetCursor(pWnd, nHitTest, message);
    }

    if (pWnd==GetDlgItem(IDC_NEXT))
    CursorID=IDC_COLORHAND;
    else
    CursorID=IDC_HAND;
    newHCursor=AfxGetApp()->LoadCursor(CursorID);
    ::SetCursor(newHCursor);
    return TRUE;
    }