Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

HiliteMenuItem function

Adds or removes highlighting from an item in a menu bar.

Syntax


BOOL WINAPI HiliteMenuItem(
  _In_  HWND hwnd,
  _In_  HMENU hmenu,
  _In_  UINT uItemHilite,
  _In_  UINT uHilite
);

Parameters

hwnd [in]

Type: HWND

A handle to the window that contains the menu.

hmenu [in]

Type: HMENU

A handle to the menu bar that contains the item.

uItemHilite [in]

Type: UINT

The menu item. This parameter is either the identifier of the menu item or the offset of the menu item in the menu bar, depending on the value of the uHilite parameter.

uHilite [in]

Type: UINT

Controls the interpretation of the uItemHilite parameter and indicates whether the menu item is highlighted. This parameter must be a combination of either MF_BYCOMMAND or MF_BYPOSITION and MF_HILITE or MF_UNHILITE.

ValueMeaning
MF_BYCOMMAND
0x00000000L

Indicates that uItemHilite gives the identifier of the menu item.

MF_BYPOSITION
0x00000400L

Indicates that uItemHilite gives the zero-based relative position of the menu item.

MF_HILITE
0x00000080L

Highlights the menu item. If this flag is not specified, the highlighting is removed from the item.

MF_UNHILITE
0x00000000L

Removes highlighting from the menu item.

 

Return value

Type: BOOL

If the menu item is set to the specified highlight state, the return value is nonzero.

If the menu item is not set to the specified highlight state, the return value is zero.

Remarks

The MF_HILITE and MF_UNHILITE flags can be used only with the HiliteMenuItem function; they cannot be used with the ModifyMenu function.

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

Winuser.h (include Windows.h)

Library

User32.lib

DLL

User32.dll

See also

Reference
ModifyMenu
Conceptual
Menus

 

 

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.