Solved

Disable and Enable a menu item that belong to popup menu

Posted on 2000-05-09
1
284 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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
sameEnds challenge 3 161
lucky13 challenge 11 147
fizzArray2 challenge 1 81
Increment column based of a FK 8 23
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…
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.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

831 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