Help Center

SetItemInfofunction

Changes information about a menu item.

Windowsfunctiondoc-orphan
No implementation located. This member is documented, but the source scan found no matching declaration. It is likely declared in a header this scan does not resolve, or provided by a macro.

Syntax

FUNCTION SetItemInfo (BYVAL hMenu AS HMENU, BYVAL item AS UINT, BYVAL fByPositon AS BOOLEAN, BYVAL pmii AS MENUITEMINFOW PTR) AS BOOLEAN
FUNCTION SetItemInfo (BYVAL hMenu AS HMENU, BYVAL item AS UINT, BYVAL fByPositon AS BOOLEAN, BYREF mii AS MENUITEMINFOW) AS BOOLEAN

Parameters

NameDescription
hMenuA handle to a menu.
itemThe identifier or position of the menu item to change. The meaning of this parameter depends on the value of fByPositon.
fByPositionThe meaning of item. If this parameter is FALSE, item is a menu item identifier. Otherwise, it is a menu item position, where position = 1 for the first position, position = 2 for the second, and so on.
pmiiA pointer to a MENUITEMINFOW structure that contains information about the menu item and specifies which menu item attributes to change.
miiA MENUITEMINFOW structure that contains information about the menu item and specifies which menu item attributes to change.

Return value

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, use the GetLastError function.

Description

Changes information about a menu item.

Remarks

The application must call the CMenu.DrawBar function whenever a menu changes, whether the menu is in a displayed window. SetItemInfo does this call internally.

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.

Reference

  • Documented in Windows/WIndows Controls/CMenu Class.md
  • Topic: About Menus