msgs12.hlp (Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
MM_SETITEMATTR (1.2)
Message Group  Overview                           Up Next Previous
────────────────────────────────────────────────────────────────────────────
 
#define INCL_WINMENUS
 
MM_SETITEMATTR
mp1 = MPFROM2SHORT((USHORT) idItem, (BOOL) fIncludeSubMenus);
mp2 = MPFROM2SHORT((USHORT) rgfMask, (USHORT) rgfData);
 
An application sends an MM_SETITEMATTR message to change the state of a menu
item's attributes.
 
Parameter         Description
────────────────────────────────────────────────────────────────────────────
 
idItem            Low word of mp1. Identifies the item.
 
fIncludeSubMenus  High word of mp1. Specifies whether to include submenus in
                  the search for an item that matches the idItem parameter.
 
rgfMask           Low word of mp2. Specifies a mask of the attributes to
                  set. This parameter can be any combination of the
                  following values:
 
                  Value         Meaning
                  ──────────────────────────────────────────────────────────
                  MIA_CHECKED   A check mark appears to the left of the menu
                                item.
 
                  MIA_DISABLED  The menu item is disabled.
 
                  MIA_FRAMED    The menu item is framed by vertical lines to
                                the left and right.
 
                  MIA_HILITED   The menu item is selected (highlighted).
 
rgfData           High word of mp2. Specifies the new state of the menu
                  item's attributes.
 
Comments
 
More than one attribute can be set with a single message by combining the
attributes to set in the rgfMask parameter and their new values in the
rgfData parameter.
 
Example
 
The following example sends an MM_SETITEMATTR message to set the IDM_LARGE
menu item's state to checked, and then sends another MM_SETITEMATTR message
to set the IDM_MEDIUM menu item's state to unchecked.
 
WinSendMsg(hwndActionBar, MM_SETITEMATTR,
    MPFROM2SHORT(IDM_LARGE, TRUE),
    MPFROM2SHORT(MIA_CHECKED, MIA_CHECKED));
WinSendMsg(hwndActionBar, MM_SETITEMATTR,
    MPFROM2SHORT(IDM_MEDIUM, TRUE),
    MPFROM2SHORT(MIA_CHECKED, FALSE));
 
Return Value
 
The return value is TRUE if the operation is successful or FALSE if an error
occurs.
 
See Also
 
MM_QUERYITEMATTR, MM_SETITEM