The WM_NCMOUSEMOVE message is posted to a window when the cursor is moved within the nonclient area of the window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.
处理WM_SETCURSOR消息BOOL CMyWnd::OnSetCursor( CWnd* pWnd, UINT nHitTest, UINT message ) { if(nHitTest==HTLEFT)// In the left border of the window. { SetCursor(...); } else if(nHitTest==HTRIGHT)// In the right border of the window. { SetCursor(...); } .... }
if(m_ImageRect.PtInRect(point))
SetCursor(LoadCursor(0,IDC_CROSS));
程序结束时在还原回来。
2.判断鼠标的point
3.条件符合就SetCursor...例如:SetCursor(LoadCursor(NULL,IDC_CROSS)
4.ReleaseCapture
{
if(nHitTest==HTLEFT)// In the left border of the window.
{
SetCursor(...);
}
else if(nHitTest==HTRIGHT)// In the right border of the window.
{
SetCursor(...);
}
.... }