SetMenuItemInfo

A version of this page is also available for

Windows Embedded CE 6.0 R3

4/8/2010

This function changes information about a menu item.

Syntax

BOOL SetMenuItemInfo(
  HMENU hMenu, 
  UINT uItem, 
  BOOL fByPosition, 
  LPCMENUITEMINFO lpmii
);

Parameters

  • hMenu
    [in] Handle to the menu that contains the menu item. Note that you must set MENUITEMINFO.cbSize to sizeof(MENUITEMINFO) before calling this function.
  • uItem
    [in] The menu item identifier or the menu item position.
  • fByPosition
    [in] Boolean value of TRUE if uItem is set to a menu item position. This parameter is set to FALSE if uItem is set to a menu item identifier.
  • lpmii
    [in] Long pointer to a MENUITEMINFO structure that contains information about the menu item and specifies which menu item attributes to change.

Return Value

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

Requirements

Header winuser.h
Library Menu.lib
Windows Embedded CE Windows CE 1.0 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also

Reference

MENUITEMINFO
Menus Functions