Highlighting a menu item in VC++

Posted on 2006-05-16
Last Modified: 2012-06-27
Hi Guys,

I want to highlight a menu item in VC++, I used the following function SetMenuItemInfo, but when I read the documentation, the documentation says that I cannot change the state of an item using this function, so I tried to send an Ownerdraw message but it also doesn't work with me, So please can anyone help me in how I can highlight a menu item?

Thanx in advance.
Question by:MAnkeer
    LVL 49

    Accepted Solution

    It is up to the user to decide which menu item to hightlight (highlighting meaning that the background of the item goes dark and the lettering goes light.  The highlighted menu item is the one that will be executed when the user presses Enter).

    I can't really think of any reason to programmatically highlight a specific menu item.  It is counter to windows GUI programming guidelines.

    You might be interested in what is called the "default" menu item -- it is the one with bold text.  Or you might be interested in setting a checkmark on an item.  Please describe your goal.

    -- Dan
    LVL 15

    Assisted Solution

    You can do the highlighting with bitmapped menus if it is worth doing it.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    The following diagram presents a diamond class hierarchy: As depicted, diamond inheritance denotes when two classes (e.g., CDerived1 and CDerived2), separately extending a common base class (e.g., CBase), are sub classed simultaneously by a fourt…
    In Easy String Encryption Using CryptoAPI in C++ ( I described how to encrypt text and recommended that the encrypted text be stored as a series of hexadecimal digits -- because cyphertext may…
    This video discusses moving either the default database or any database to a new volume.
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

    745 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

    18 Experts available now in Live!

    Get 1:1 Help Now