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>enablemenuitem()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
EnableMenuItem()
Enable, disable or gray (dim) a menu item
------------------------------------------------------------------------------

Syntax
EnableMenuItem( <aMenu>, <cId>, <nFlag> )   -->  nOldState

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

<cId> is a character string identifying the item being
manipulated.

<nFlag> specifies the new state of the menu item.  Use one of
the values MF_ENABLED, MF_DISABLED, or MF_GRAYED defined in
WINDOWS.CH.

Returns
An integer is returned giving the old state of the item.  This
is zero (0) if the item was previously disabled, one (1) if it
was previously enabled, and -1 if the item does not exist.

Description
This function is used to modify an item in an existing menu
structure.

Example
// The famous File...Exit menu
aMenu = CreateMenu()
aPopupMenu = CreatePopupMenu()
AppendMenu( aPopupMenu, "exit", MF_ENABLED + MF_STRING,     ;
            "E&xit", {|cId| DoExit()} )
AppendMenu( aMenu, "file", MF_ENABLED + MF_POPUP,           ;
            "&File", aPopupMenu )
SetMenu( hWnd, aMenu )
// this would probably annoy the user ...
EnableMenuItem( aPopupMenu, "exit", MF_DISABLED )
DrawMenuBar( hWnd )


See Also: CreateMenu() CreatePopupMenu() SetMenu()

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