重载OnSetCursor函数

BOOL CTest::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message)
{
if (pWnd->GetDlgCtrlID() == IDC_TEST) //IDC_TEST 控件ID
{
HCURSOR hCursor = LoadCursor(NULL,IDC_HAND);   

return hCursor != NULL ? (SetCursor(hCursor) != NULL) : FALSE;
}

return CDialogEx::OnSetCursor(pWnd, nHitTest, message);
}

posted on 2013-04-24 17:18  ximenchuixie  阅读(431)  评论(0编辑  收藏  举报