Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Disable and Enable a menu item that belong to popup menu

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

Enroll in September's Course of the Month

This month’s featured course covers 16 hours of training in installation, management, and deployment of VMware vSphere virtualization environments. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

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…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…

721 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