Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Disable and Enable a menu item that belong to popup menu

Posted on 2000-05-09
1
Medium Priority
?
294 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 10 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

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

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

Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
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.
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses

877 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