Setzt den Status eines Menüitems
#include <GuiMenu.au3>
_GUICtrlMenu_SetItemState ( $hMenu, $iItem, $iState [, $bState = True [, $bByPos = True]] )
$hMenu | Handle des Menüs |
$iItem | ID oder Position des Menüitems |
$iState | Menüitem Status: $MFS_CHECKED - Item ist markiert $MFS_DEFAULT - Item ist das Standarditem $MFS_DISABLED - Item ist deaktiviert $MFS_GRAYED - Item ist ausgegraut $MFS_HILITE - Item ist hervorgehoben |
$bState | [optional] zu setzender Itemstatus: True - State ist aktiviert False - State is deaktiviert |
$bByPos | [optional] Menü ID Flag: True - $iItem ist eine 0-basierende Itemposition False - $iItem ist eine Menüitem ID |
Erfolg: | True |
Fehler: | False |
- - - - - - - - Erklärung der Controls - - - - - - - -
_GUICtrlMenu_GetItemState, _GUICtrlMenu_GetItemStateEx
#include <GuiMenu.au3>
Example()
Func Example()
Local $hWnd, $hMain, $hFile
; Startet den Editor
Run("notepad.exe")
WinWaitActive("[CLASS:Notepad]")
$hWnd = WinGetHandle("[CLASS:Notepad]")
$hMain = _GUICtrlMenu_GetMenu($hWnd)
$hFile = _GUICtrlMenu_GetItemSubMenu($hMain, 0)
; Ermittelt den Status des Öffnen-Items
_GUICtrlMenu_SetItemState($hFile, 1, $MFS_CHECKED)
Writeln("Status des Öffnen-Items: " & _GUICtrlMenu_GetItemStateEx($hFile, 1))
EndFunc ;==>Example
; Schreibt eine Zeile mit Text in den Editor
Func Writeln($sText)
ControlSend("[CLASS:Notepad]", "", "Edit1", $sText & @CRLF)
EndFunc ;==>Writeln