[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 288
  • Last Modified:

Highlighting a menu item in VC++

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.
2 Solutions
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
You can do the highlighting with bitmapped menus if it is worth doing it.

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now