Solved

WM_CONTEXTMENU and CEdit

Posted on 1997-04-01
2
635 Views
Last Modified: 2013-11-20
I am programming online help, F1 and Shift-F1 for my application.  I am able to cause the "What's this?" context menu to be displayed for every control on my CFormView except for the CEdit and CCombobox controls.  The edit control does not seem to pass the WM_CONTEXTMENU (VC++ 4.1)  message to it's parent.  Is there a way to append the "What's this?" item to the default edit control context menu?  I'd like to be able to do it from the parent without subclassing the control(s).
0
Comment
Question by:FSmullin
2 Comments
 
LVL 23

Accepted Solution

by:
chensu earned 100 total points
ID: 1300797
You have to subclass the control. Because if you do not, what the system notifies you when the right mouse button is clicked on the edit box is only WM_PARENTNOTIFY. You can display your context menu when you receive WM_PARENTNOTIFY, but you can not disable the context menu created by the edit box. I think the best way is to subclass the edit box and handle the WM_CONTEXTMENU to create your own menu.
0
 

Expert Comment

by:prabha040297
ID: 1300798
You can catch "WM_INITMENUPOPUP" message. The framework sends this message when a pop-up menu is about to become active. This allows an application to modify the pop-up menu before it is displayed without changing the entire menu.

Note:   This member function is called by the framework to allow your application to handle a Windows message. The parameters passed to your function reflect the parameters received by the framework when the message was received. If you call the base-class implementation of this function, that implementation will use the parameters originally passed with the message and not the parameters you supply to the function.
 


 

0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Installing Microsoft R server on REDHAT or SUSE Linux 4 152
FizzBuzz challenge 9 83
Problem to event 3 112
Problem to Office 1 39
Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
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.
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

679 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