Solved

WM_CONTEXTMENU and CEdit

Posted on 1997-04-01
2
641 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Independent Software Vendors: 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
Show shut-down message as Windows 8 shuts down. 9 109
List out all word 7 354
zeroMAx challenge 20 135
sumHeights  challenge 17 83
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‚Ķ
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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 video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

732 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