SetMenuItemInfo

This function changes information about a menu item.

At a Glance

Header file: Winuser.h
Windows CE versions: 1.0 and later

Syntax

BOOL SetMenuItemInfo(HMENU hmenu, UINT uItem, BOOL fByPosition,
LPCMENUITEMINFO pmii);

Parameters

hMenu

[in] Handle to the menu that contains the menu item.

uItem

[in] Specifies the identifier or position of the menu item to change. The meaning of this parameter depends on the value of fByPosition.

fByPosition

[in] Value that specifies the meaning of uItem. If this parameter is FALSE, uItem is a menu item identifier. Otherwise, it is a menu item position.

lpmii

[in] Long pointer to a MENUITEMINFO structure that contains information about the menu item and specifies which menu item attributes to change.

Return Values

Nonzero indicates success. Zero indicates failure. To get extended error information, call GetLastError.

Remarks

Use SetMenuItemInfo to set the menu item content, an application-defined identifier, and application-defined data. SetMenuItemInfo can also set the menu item type, but it cannot change the type.

SetMenuItemInfo cannot set the menu item state, submenu, and check mark bitmaps.

In order for keyboard accelerators to work with bitmap or owner-drawn menu items, the owner of the menu must process the WM_MENUCHAR message.