Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- The Guide to Clip-4-Win version 3.0 - <b>checkmenuitem()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
CheckMenuItem()
Add/remove a check mark for a pop-up menu item
------------------------------------------------------------------------------

Syntax
CheckMenuItem( <aMenu>, [ <cId> | <nId> ], <nFlags> )   -->  nOldState

Arguments
<aMenu> is the existing menu, originally obtained from
CreateMenu() or CreatePopupMenu().

<cId> is an optional character string identifying the item
whose state is to be changed.  Any string previously used with
the AppendMenu() function may be used, so long as it
identifies a pop-up menu item (i.e. not a top-level item).

<nId> is an optional number identifying the position of the
item to be changed.  Specifying the position this way is
awkward, so is not recommended.

<nFlags> specifies whether the check mark should be added
(MF_CHECKED) or removed (MF_UNCHECKED).

Returns
If the item does not exist, -1 is returned.  Otherwise, an
integer representing the previous state of the menu item is
returned.

Description
The state of the indicated menu item will be altered, and the
previous state returned (either MF_CHECKED or MF_UNCHECKED;
see WINDOWS.CH).

Example
aMenu = CreateMenu()
aPopupMenu = CreatePopupMenu()
AppendMenu( aMenu, "help", MF_ENABLED + MF_POPUP,
            "&Help", aPopupMenu)
AppendMenu( aPopupMenu, "about", MF_ENABLED + MF_STRING,
            "&About", { || DoAbout() } )
nOldState = CheckMenuItem( aMenu, "about", MF_UNCHECKED )
// Result:  MF_UNCHECKED


See Also: AppendMenu() CreateMenu() CreatePopupMenu() GetMenu() GetMenuItemCount() GetMenuString() SetMenu()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson