CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2008
    Location
    Earth
    Posts
    60

    RichEdit CONTEXTMENU Cursor Fix

    if your having trouble with the RichEdit control not displaying the proper cursor during a right click contextmenu, here is the fix for it...

    Code:
    ////the message handler
        case WM_SETCURSOR:
        {
            if(m_bMenuOpen)
            {
                HCURSOR m_hArrow = LoadCursor(NULL,IDC_ARROW);
                ::SetCursor(m_hArrow);
                return TRUE;
            }
            break;
        }
    ////////////////////////
    
    
    ///the menu function...
        m_bMenuOpen = TRUE;
        TrackPopupMenu(hMenu,0,pt.x,pt.y,0,m_hWnd,NULL);
        m_bMenuOpen = FALSE;
    ///////////////////////////
    the standard ::SetCursor does not work for the RichEdit controls, figured this would help some people out doing searches on here, I know I found nothing on the net or during searches on here on the subject

  2. #2
    Join Date
    Dec 2010
    Posts
    2

    Cool Re: RichEdit CONTEXTMENU Cursor Fix

    Quote Originally Posted by 12oclocker View Post
    if your having trouble with the RichEdit control not displaying the proper cursor during a right click contextmenu, here is the fix for it...

    EDIT: removed code

    the standard ::SetCursor does not work for the RichEdit controls, figured this would help some people out doing searches on here, I know I found nothing on the net or during searches on here on the subject
    Hello, 12oclocker. I signed up for this forum just so I could make this post!!
    Firstly: THANK YOU! I was just wondering why SetCursor was not working...!
    I was completely unaware I needed to return TRUE as opposed to returning nothing at all.

    There appears to be a slight lack of information when it comes to the Win32 API and MSDN.

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