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
Solved

Cursor on CRichEditView

Posted on 2002-04-02
3
297 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
  • 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: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

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

Suggested Solutions

Title # Comments Views Activity
ODBC Connection Logging, ADO.NET 6 69
lucky13 challenge 11 153
sum28 challenge 31 115
wordcount challenge 11 129
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…
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

792 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