Retrieves the status of the menu item disabled state
#include <GuiMenu.au3>
_GUICtrlMenu_GetItemDisabled ( $hMenu, $iItem [, $bByPos = True] )
$hMenu | Handle of the menu |
$iItem | Identifier or position of the menu item |
$bByPos | [optional] Menu identifier flag: True - $iItem is a 0-based item position False - $iItem is a menu item identifier |
True: | $iItem is disabled. |
False: | $iItem is not disabled. |
#include <GuiMenu.au3>
Example()
Func Example()
Local $hWnd, $hMain, $hFile
; Open Notepad
Run("notepad.exe")
WinWaitActive("[CLASS:Notepad]")
$hWnd = WinGetHandle("[CLASS:Notepad]")
$hMain = _GUICtrlMenu_GetMenu($hWnd)
$hFile = _GUICtrlMenu_GetItemSubMenu($hMain, 0)
; Get/Set Open enabled
Writeln("Open is disabled: " & _GUICtrlMenu_GetItemDisabled($hFile, 1))
_GUICtrlMenu_SetItemDisabled($hFile, 1)
Writeln("Open is disabled: " & _GUICtrlMenu_GetItemDisabled($hFile, 1))
_GUICtrlMenu_SetItemEnabled($hFile, 1)
Writeln("Open is enabled : " & _GUICtrlMenu_GetItemEnabled($hFile, 1))
EndFunc ;==>Example
; Write a line of text to Notepad
Func Writeln($sText)
ControlSend("[CLASS:Notepad]", "", "Edit1", $sText & @CRLF)
EndFunc ;==>Writeln