CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 1999
    Posts
    15

    How do I set the cursor of a CView?

    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.


  2. #2
    Join Date
    Apr 1999
    Posts
    12

    Re: How do I set the cursor of a CView?

    Handle the WM_SETCURSOR message and set it there.


  3. #3
    Join Date
    May 1999
    Posts
    69

    Re: How do I set the cursor of a CView?

    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.


  4. #4
    Guest

    Re: How do I set the cursor of a CView?

    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;
    }



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured