我做了一个绘图程序,当选择要绘图时,我想让光标显示为十字,我在online的消息处理函数中是这样定义的:
void CMyView::OnLine()
{
// TODO: Add your command handler code here
m_type=1;
HCURSOR m_myCursor;
m_myCursor=AfxGetApp()->LoadStandardCursor(IDC_CROSS);
SetCursor(m_myCursor);
}
但运行时光标没有变化,我哪里错了?还有就是当我设置成功为十字后如何恢复光标?
void CMyView::OnLine()
{
// TODO: Add your command handler code here
m_type=1;
HCURSOR m_myCursor;
m_myCursor=AfxGetApp()->LoadStandardCursor(IDC_CROSS);
SetCursor(m_myCursor);
}
但运行时光标没有变化,我哪里错了?还有就是当我设置成功为十字后如何恢复光标?
HCURSOR m_hCursor; // 成员变量
BOOL CXXXView::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message)
{
// TODO: Add your message handler code here and/or call default
SetCursor(m_hCursor); return TRUE;
//return CView::OnSetCursor(pWnd, nHitTest, message);
}