CWnd::HiliteMenuItem

Highlights or removes the highlight from a top-level (menu-bar) menu item.

BOOL HiliteMenuItem( 
   CMenu* pMenu, 
   UINT nIDHiliteItem, 
   UINT nHilite  
);

Parameters

  • pMenu
    Identifies the top-level menu that contains the item to be highlighted.

  • nIDHiliteItem
    Specifies the menu item to be highlighted, depending on the value of the nHilite parameter.

  • nHilite
    Specifies whether the menu item is highlighted or the highlight is removed. It can be a combination of MF_HILITE or MF_UNHILITE with MF_BYCOMMAND or MF_BYPOSITION. The values can be combined using the bitwise OR operator. These values have the following meanings:

    • MF_BYCOMMAND   Interprets nIDHiliteItem as the menu-item ID (the default interpretation).

    • MF_BYPOSITION   Interprets nIDHiliteItem as the zero-based offset of the menu item.

    • MF_HILITE   Highlights the item. If this value is not given, the highlight is removed from the item.

    • MF_UNHILITE   Removes the highlight from the item.

Return Value

Specifies whether the menu item was highlighted. Nonzero if the item was highlighted; otherwise 0.

Remarks

The MF_HILITE and MF_UNHILITE flags can be used only with this member function; they cannot be used with the CMenu::ModifyMenu member function.

Requirements

Header: afxwin.h

See Also

Reference

CWnd Class

Hierarchy Chart

CMenu::ModifyMenu

HiliteMenuItem