MFC,光标区域内变化的问题
BOOLCChildView::OnSetCursor(CWnd*pWnd,UINTnHitTest,UINTmessage){if(nHitTest==HTCLIENT...
BOOL CChildView::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message)
{
if(nHitTest == HTCLIENT)
{
CPoint point;
::GetCursorPos(&point);
ScreenToClient(&point);
CRect rect(496, 528, 524, 564);
if(rect.PtInRect(point))
::SetCursor(AfxGetApp()->LoadCursor(IDC_HAND));
else
::SetCursor(AfxGetApp()->LoadStandardCursor(IDC_CROSS)); //2
return TRUE;
}
-----------------------------------------------------------------------------
我已经设置了在一个区域矩形内光标变化,但是我还想设置另一个区域例如rect(442,528 , 474, 564),应该怎么添加程序 展开
{
if(nHitTest == HTCLIENT)
{
CPoint point;
::GetCursorPos(&point);
ScreenToClient(&point);
CRect rect(496, 528, 524, 564);
if(rect.PtInRect(point))
::SetCursor(AfxGetApp()->LoadCursor(IDC_HAND));
else
::SetCursor(AfxGetApp()->LoadStandardCursor(IDC_CROSS)); //2
return TRUE;
}
-----------------------------------------------------------------------------
我已经设置了在一个区域矩形内光标变化,但是我还想设置另一个区域例如rect(442,528 , 474, 564),应该怎么添加程序 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询