windows_设置鼠标

1. 在XXdlg.h 中声明函数OnSetCursor

    afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
    DECLARE_MESSAGE_MAP()
};

2.写入消息映射 

  ON_WM_SETCURSOR(IDD_SETCUR_DIALOG, &CsetcurDlg::OnSetCursor)
END_MESSAGE_MAP()


3.实现设置函数

BOOL CsetcurDlg::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message)
{

    HCURSOR hcur = LoadCursor(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDC_CURSOR1));
    SetCursor(hcur);
    return TRUE;
}



猜你喜欢

转载自blog.csdn.net/fengdijiang/article/details/7699003