• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 252
  • Last Modified:

Detect right click in richeditview

How can I detect a right click in a richeditview?  I create the ctrl itself, and in Class Wizard I cannot see anything that'll let me detect the click.  I manually added this, but it doesn't work...

View's header file:
afx_msg void OnRclickView(NMHDR* pNMHDR, LRESULT* pResult);

View's .cpp file: (message map)
ON_NOTIFY(NM_RCLICK, IDC_EDITVIEW, OnRclickView)

0
knewton76
Asked:
knewton76
1 Solution
 
Vinayak KumbarSr Program ManagerCommented:
Hi,

U r creating the control for Urself?. Then do the following.

1. Use the class wizard to create a new class derived from CRichEdit say CMyRichEdit.

2. Then create the control, but this time dont specify CRichEdit, instead specify CMyRichEdit and u have to include the header file MyRichEdit.h to that file.

3. Then Go to class wizard and select the class as CMyRichEdit, u will get the WM_RBUTTONCLICK message handler, map it to CMyRichEdit class.

Now u will get that message.
Hope this helps.
VinExpert
0
 
knewton76Author Commented:
Maybe I'm doing something wrong, but when I create a new richedit class, I only see messages for WM_RBUTTONDOWN, WM_RBUTTONUP, WM_RBUTTONDBCLK.  Oh well, mapping to WM_RBUTTONDOWN works just as well.
0

Featured Post

Learn to develop an Android App

Want to increase your earning potential in 2018? Pad your resume with app building experience. Learn how with this hands-on course.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now