Solved

Disable and Enable a menu item that belong to popup menu

Posted on 2000-05-09
1
281 Views
Last Modified: 2013-11-20
Please help me with the following problem.

I have a pop-up menu which will pop-up only when i right-click on a tree item.

I know to enable and disable a menu item that belong to CMainFrame :-
pCmdUI->Enable(TRUE);
coz' the menu item is belong to that class.

Since the pop-up menu is standalone, and it does not belong to any class, so how do I enable and disable a menu item that is a pop-up menu?

Please help me. Thank you to those who is/are willing to help me.
0
Comment
Question by:alicia99
1 Comment
 
LVL 2

Accepted Solution

by:
aquila98 earned 5 total points
ID: 2792782
Hi,

I do beleive you have to add message handlers on any window
that the pop up acts upon... In you case since its a tree it could
be the MainFrame I guess...
like this
ON_UPDATE_COMMAND_UI(ID_POPUP_CMD1, OnUpdatePopCMD1)
and of course
ON_COMMAND(ID_POPUP_CMD1, OnPopCMD1)

If many different windows can receive your pop up commands
(like if it has a Copy for instance) each will have to handle the
message and can separatly activate or not the option. That's how
some windows can add or alter the popup at will... Like if some
item in your tree have different option on the popup
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
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 gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

762 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

18 Experts available now in Live!

Get 1:1 Help Now