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 0 |
- - - - - - - - Erklärung der Controls - - - - - - - -
$tagMENUITEMINFO, _GUICtrlMenu_SetItemInfo
Suche nach GetMenuItemInfo in der MSDN Bibliothek.
#include "Extras\HelpFileInternals.au3"
#include <GuiMenu.au3>
Global $g_hWnd
Example()
Func Example()
Local $hMain, $hFile, $tInfo
; Startet den Editor
Run("notepad.exe")
$g_hWnd = WinWaitActive("[CLASS:Notepad]")
$hMain = _GUICtrlMenu_GetMenu($g_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"))
_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