用SetCursor为什么不能改变光标?
BOOL CDlg::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message)
{
// TODO: Add your message handler code here and/or call
default
if(m_hcursor)
{
HCURSOR hOld = ::SetCursor(m_hcursor);
}
return CDialog::OnSetCursor(pWnd, nHitTest, message);
}
原因:
直接return TRUE,表示光标已经设置
不要return CDialog::OnSetCursor(pWnd, nHitTest, message);
否则光标会被CDialog::OnSetCursor()再设回去编程默认的。