Popup Menu implementation on a PropertyPage

Posted on 2005-05-03
Last Modified: 2013-11-20
Dear All.

    I want to implement a right click popup menu on a Property page. OnRButtonDown i am able to open the menu but no menuitems are enabled. I have defind the Click messages on the Property page itself and EnableMenuItem() and ON_UPDATE.. macro are also there in the same class but nothing is working?  what should i do?

  I Created a Test application, added a dialog and OnRButtonDown i opened a Menu and it is working fine. but this is not the case in CPropertyPage.

Thanks in Advance.
- nksaxena
Question by:nksaxena
    LVL 55

    Expert Comment

    by:Jaime Olivares
    OnRButtonDown i am able to open the menu but no menuitems are enabled.
    I think your options are not enabled because you don't have a message handler for every option.
    This also occurs with an application's main menu, when you define menu options, but you don't implement every option with a related function (usually done with ClassWizard)

    LVL 1

    Author Comment

    Thanks for replying Jaime..

       I have defined BN_CLICKED for each menu item and ON_UPDATE  UI messages to enable them in my PropertyPage, classwizards finds them easily. but they are not enabled. Perhaps things can be changed if i can create a 'View' for the PropertyPage.

    LVL 1

    Author Comment

    Hay!! i solved it ! Actually the last argument in TrackPopupMenu call was incorrect. which is a pointer to the window where all message handlers are defined.

    Thanks again.

    Accepted Solution

    PAQed with points refunded (250)

    Community Support Moderator

    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    Join & Write a Comment

    Suggested Solutions

    Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
    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. …
    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.
    how to add IIS SMTP to handle application/Scanner relays into office 365.

    755 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

    19 Experts available now in Live!

    Get 1:1 Help Now