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 "Extras\HelpFileInternals.au3"
#include <GuiMenu.au3>
Global $g_hWnd
Example()
Func Example()
Local $hMain, $hFile
; Startet den Editor
Run("notepad.exe")
$g_hWnd = WinWaitActive("[CLASS:Notepad]")
$hMain = _GUICtrlMenu_GetMenu($g_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))
_NotepadForceClose($g_hWnd)
EndFunc ;==>Example
; Schreibt eine Zeile mit Text in den Editor
Func Writeln($sText, $hWnd = $g_hWnd)
ControlSend($hWnd, "", ControlGetFocus($hWnd), $sText & @CRLF)
EndFunc ;==>Writeln