SetClassLong,GetClassLong 动态改变光标

void CTestCursorDlg::OnLButtonUp(UINT nFlags, CPoint point)
{
 // TODO: Add your message handler code here and/or call default
 SetClassLong(m_hWnd,GCL_HCURSOR,(long)m_hCursor);
 CDialog::OnLButtonUp(nFlags, point);
} void CTestCursorDlg::OnLButtonDown(UINT nFlags, CPoint point)
{
 // TODO: Add your message handler code here and/or call default
 m_hCursor=(HCURSOR)GetClassLong(m_hWnd,GCL_HCURSOR);
 SetClassLong(m_hWnd,GCL_HCURSOR,(long)(LoadCursor(NULL,IDC_CROSS)));
 CDialog::OnLButtonDown(nFlags, point);
}

你可能感兴趣的:(API)