Solved

Disable and Enable a menu item that belong to popup menu

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

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: 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: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
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.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

861 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

24 Experts available now in Live!

Get 1:1 Help Now