Click to See Complete Forum and Search --> : Context menu question


Matthew Smith
March 29th, 1999, 01:12 PM
Hi:


I have an application that uses a richedit doc/view architecture for the main editing window. It also has a dialog bar with a Rich Edit Control embedded in it for an output window. This Rich Edit Control is created dynamicaly using "Create" in the dialog bar class. My question is, how do I go about setting up a context menu for this Rich Edit Control?


thanks,

-Matt

Dan O'Brien
March 29th, 1999, 01:14 PM
I would suggest subclassing the edit control and handling its WM_CONTEXTMENU messages.

Matthew Smith
March 29th, 1999, 01:23 PM
Ok, that's along the lines of what I was thinking I needed to do. I derived a 'wrapper' class from CRichEditCtrl, where I handle the WM_CONTEXTMENU message. My question is, how do I go about implementing the subclassing? Thanks very much.


-Matt

sally
March 29th, 1999, 05:44 PM
can you be more specigic about your problem?

Sally
March 29th, 1999, 05:44 PM
can you be more specigic about your problem?

Matthew Smith
March 29th, 1999, 06:26 PM
Certainly. Here is what I'm doing: I have an application with 2 windows. The main window is a Rich Edit Control used for editing, and uses doc/view. I also have a dialog bar docked at the bottom of the screen with a CRichEditCtrl embedded in it, used for an output window. The CRichEditCtrl is a member of the dialog bar class and is created dynamically using the Create() function. I want to be able to create a context menu for the CRichEditCtrl embedded in the dialog bar. I tried deriving a class from CRichEditCtrl, and trapping WM_CONTEXTMENU, but that didn't work. It was suggested here that I need to use subclassing (a concept I understand, but haven't used before). I basically need to know how, and where to use the subclassing. If you need any more info, please let me know. Thanks for all your help.


cheers,

-Matt

sally
March 29th, 1999, 06:44 PM
I beleived that by deriving a class from CRichEditCtrl and using that WAS subclassing.


Why didn't trapping WM_CONTEXTMENU work?


Sally

Sally
March 29th, 1999, 06:44 PM
I beleived that by deriving a class from CRichEditCtrl and using that WAS subclassing.


Why didn't trapping WM_CONTEXTMENU work?


Sally