Solved

WM_CONTEXTMENU and CEdit

Posted on 1997-04-01
2
614 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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
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.
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.

706 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now