How do I set the cursor of a CView to a custom cursor so that whent he user moves the mouse over it the cursor changes to the custom cursor ove the CView and normal off the CView. I have one way, but it creates a LOT of flicker.
Printable View
How do I set the cursor of a CView to a custom cursor so that whent he user moves the mouse over it the cursor changes to the custom cursor ove the CView and normal off the CView. I have one way, but it creates a LOT of flicker.
Handle the WM_SETCURSOR message and set it there.
To remove the flicker, register your window class using AfxRegisterWndClass() in the PreCreateWindow() function... make sure to set the default cursor (I think it's the 2nd parameter) to NULL.
You can set the cursor by overriding the OnSetCursor function, all you do is add a call to SetCursor passing in a handle to a previously created cursor.
BOOL CMyView::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message)
{
SetCursor (m_hWaitCursor);
return TRUE;
}