次の方法で共有


SetMenuItemInfo (Compact 2013)

3/28/2014

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. You must set the cbSize member of MENUITEMINFO 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 data (the dwItemData member of MENUITEMINFO), but it cannot change the type (the fType member of MENUITEMINFO).

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

See Also

Reference

Menu Functions
MENUITEMINFO