Function Reference


_GUICtrlMenu_EnableMenuItem

Enables, disables, or grays the specified menu item

#include <GuiMenu.au3>
_GUICtrlMenu_EnableMenuItem ( $hMenu, $iItem [, $iState = 0 [, $bByPos = True]] )

Parameters

$hMenu Menu handle
$iItem Identifier or position of the menu item
$iState [optional] Indicates whether the menu item is enabled, disabled, or grayed:
    0 - Enabled
    1 - Grayed
    2 - Disabled
$bByPos [optional] Menu identifier flag:
    True - $iItem is a 0-based item position
    False - $iItem is a menu item identifier

Return Value

Success: True.
Failure: False.

See Also

Search EnableMenuItem in MSDN Library.

Example

#include <GuiMenu.au3>

Example()

Func Example()
    Local $hWnd, $hMain

    Run("notepad.exe")
    WinWaitActive("[CLASS:Notepad]")
    $hWnd = WinGetHandle("[CLASS:Notepad]")
    $hMain = _GUICtrlMenu_GetMenu($hWnd)

    ; Disable/Gray Help menu
    _GUICtrlMenu_EnableMenuItem($hMain, 4, 3)
EndFunc   ;==>Example