SetItemIcon
SetItemIcon Select a menu icon by its resource ID
#include <Menus.h> Menu Manager
void SetItemIcon(theMenu, whichItem, iconSelector );
MenuHandle theMenu ; handle of menu containing item of inquiry
short whichItem ; ID of an item in theMenu
short iconSelector 'ICON' or 'cicn' resource ID less 256 (1=257, etc.)
SetItemIcon selects an icon to be displayed for a specified menu item. All
such icons are read from resource files.
theMenu is a handle leading to a variable-length MenuInfo structure. It
identifies the menu containing the item whose icon you wish to
change.
whichItem identifies which item in menu theMenu to query. Items are
numbered sequentially with the topmost item having an ID of 1.
iconSelector identifies which icon you wish to use. It is 256 less than the
resource ID of the desired icon. For instance, to use an icon with
'ICON' or 'cicn' resource ID of 259, use iconSelector = 3.
Returns: none

Notes: By default, items have no icon unless one is specified by including the " ^
metacharacter in the item text when it is added to the menu (see
When using the default menu definition procedures, icons are used rarely.
They are displayed full-size (32 x 32 dots), take up a lot of space on the
menu, and are generally superfluous.
The effect of this call is to simply store a byte in the item record of the
MenuInfo structure. If you install a custom menu handler, you can define
small icons, or make rows and columns, or do other creative things. See
Custom Menus.
This does not provide an error return code. To determine if the icon
exists, use ResError or GetItemIcon to make sure the icon was read
correctly.
On 256K ROMs, the Menu Manager attempts to locate a 'cicn' (color icon)
resource to match iconSelector and, if none is found, it looks for an 'ICON'
resource. See Color Menus.
Since the release of MultiFinder, the Menu Manager has been modified to
support small icons ('SICN' resources). To use a small icon to a menu item,
use Rez or ResEdit to:
Reduced Icon
Place a value of 0x1D into the cmdChr field of the menuItem
Place the resource number of the 'ICON' to use, minus 256, into the
itemIcon field of the menuItem
Small Icon
Place a value of 0x1E into the cmdChr field of the menuItem
Place the resource ID number of the 'SICN' to use, minus 256, into
the itemIcon field of the menuItem
In ResEdit, the cmdChr field is called "Key equiv" and the itemIcon field is
called "Icon#". To set or change the menu from within your program, use
SetItemCmd(theMenu, item, 0x1D);/* to get a reduced icon */
SetItemIcon(theMenu,item,icon);
or
SetItemCmd(theMenu,item,0x1E); /* to get a small icon */
SetItemIcon(theMenu,item,icon);
Since the resource ID that you pass to the Menu Manager is 256 less than
the icon's real resource ID, you must use icons starting with ID's of 257
(remember that a zero indicates no icon).
Remember that by using a small icon, you cannot have a command key
equivalent, since the cmdChr field of the menu item is now used to indicate
both the command key to use or the use of a small icon.