?
Solved

Cursor on CRichEditView

Posted on 2002-04-02
3
Medium Priority
?
300 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 600 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
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, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses
Course of the Month12 days, 18 hours left to enroll

777 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