Important: The information in this document is obsolete and should not be used for new development.
SetItemIcon
Use theSetItemIconprocedure to set the icon number or script code of a specific menu item. Usually you display menu items in the current system script; however, if needed, you can use theSetItemIconprocedure to set the script code of a menu item. For an item's script code to be set, the keyboard equivalent field of the item must contain $1C. If the keyboard equivalent field contains any other value, theSetItemIconprocedure interprets the specified number as the item's icon number.
PROCEDURE SetItemIcon (theMenu: MenuHandle; item: Integer; iconIndex: Byte);
theMenu- A handle to the menu record of the menu containing the menu item whose icon (or script code) you wish to set.
item- The item number of the menu item. The
SetItemIconprocedure sets the icon (or script code) of this item.iconIndex- If the menu item's keyboard equivalent field does not contain $1C, the
SetItemIconprocedure sets the icon number of the item's icon to the number defined in this parameter. The icon number you specify should be a value from 1 through 255 (or from 1 through 254 if the item has a small or reduced icon) or 0 if the item does not have an icon.- The Menu Manager adds 256 to the icon number to generate the resource ID of the
'cicn'or'ICON'resource that describes the icon of the menu item. For example, if you specify 5 as the value of theiconIndexparameter, when the Menu Manager needs to draw the item, it looks for an icon resource with resource ID 261.- If the menu item's keyboard equivalent field contains $1C, the
SetItemIconprocedure sets the script code of the menu item to the number defined in theiconIndexparameter. The Menu Manager displays the menu item using the specified script code if the corresponding script system is installed.- You can specify 0 in the
iconIndexparameter to indicate that the item uses the current system script and does not have an icon number.DESCRIPTION
TheSetItemIconprocedure sets the icon number or script code of the specified menu item to the value in theiconIndexparameter.SEE ALSO
See "Changing the Icon or Script Code of Menu Items" beginning on page 3-62 for examples of setting the icon of a menu item.