Ermittelt Informationen über ein Menüitem
#include <GuiMenu.au3>
_GUICtrlMenu_GetItemInfo ( $hMenu, $iItem [, $bByPos = True] )
$hMenu | Handle des Menüs |
$iItem | ID oder Position des Menüitems |
$bByPos | [optional] Menü-ID Flag: True - $iItem ist eine 0-basierende Itemposition False - $iItem ist eine Menüitem ID |
Erfolg: | $tagMENUITEMINFO Struktur |
Fehler: | Setzt das @error Flag auf ungleich null |
- - - - - - - - Erklärung der Controls - - - - - - - -
$tagMENUITEMINFO, _GUICtrlMenu_SetItemInfo
Suche nach GetMenuItemInfo in der MSDN Bibliothek.
#include <GuiMenu.au3>
Example()
Func Example()
Local $hWnd, $hMain, $hFile, $tInfo
; Startet den Editor
Run("notepad.exe")
WinWaitActive("[CLASS:Notepad]")
$hWnd = WinGetHandle("[CLASS:Notepad]")
$hMain = _GUICtrlMenu_GetMenu($hWnd)
$hFile = _GUICtrlMenu_GetItemSubMenu($hMain, 0)
; Ermittelt Informationen über den Menüpunkt 'Öffnen'
$tInfo = _GUICtrlMenu_GetItemInfo($hFile, 1)
Writeln("ID des Menüpunktes 'Öffnen': " & DllStructGetData($tInfo, "ID"))
DllStructSetData($tInfo, "ID", 0)
_GUICtrlMenu_SetItemInfo($hFile, 1, $tInfo)
$tInfo = _GUICtrlMenu_GetItemInfo($hFile, 1)
Writeln("ID des Menüpunktes 'Öffnen': " & DllStructGetData($tInfo, "ID"))
EndFunc ;==>Example
; Schreibt eine Zeile mit Text in den Editor
Func Writeln($sText)
ControlSend("[CLASS:Notepad]", "", "Edit1", $sText & @CRLF)
EndFunc ;==>Writeln