Solved

Cursor on CRichEditView

Posted on 2002-04-02
3
299 Views
Last Modified: 2013-11-20
I want to show context menu on CRichEditView. So I overloaded OnRButtonDown function (OnContextMenu does not work) and inside the function I am calling
SetCursor(LoadCursor(NULL,IDC_ARROW));
just before calling TrackPopupMenu function. I want to have arrow cursor on the context menu. But it is not showing the arrow cursor. Why is that so? How can I show arrow cursor on context menu.
Why OnContextMenu does not work, I mean it is not getting called on R-click.
0
Comment
Question by:chhakuli
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 86

Accepted Solution

by:
jkr earned 150 total points
ID: 6913776
You'll have to override 'OnSetCursor()' also, otherwise the system will revert to the default cursor...
0
 
LVL 2

Expert Comment

by:manojbkumar
ID: 6914864
To Display context menu in a RichEditView u should override
GetContextMenu()

in the public sction of view header add
virtual HMENU GetContextMenu( WORD seltyp, LPOLEOBJECT lpoleobj, CHARRANGE* lpchrg );
and then in cpp

HMENU CMyRichEditView::GetContextMenu(WORD, LPOLEOBJECT, CHARRANGE* )
{
     CMenu Menu;
     Menu.LoadMenu(IDR_MENU1);

     CMenu *pMenu = Menu.GetSubMenu(0);
     if(pMenu)
     {
          Menu.RemoveMenu(0, MF_BYPOSITION);
          pMenu->TrackPopupMenu(TPM_LEFTALIGN   ,point.x,point.y, AfxGetMainWnd());
          return pMenu->Detach();
     }
     return NULL;
     
}
0
 
LVL 2

Expert Comment

by:manojbkumar
ID: 6915134
Sorry there is a mistake in the code.Remove the line

pMenu->TrackPopupMenu(TPM_LEFTALIGN   ,point.x,point.y, AfxGetMainWnd());
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question