Solved

WM_CONTEXTMENU and CEdit

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

943 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

5 Experts available now in Live!

Get 1:1 Help Now