Ermittelt, ob ein Menüpunkt den Standardstatus besitzt
#include <GuiMenu.au3>
_GUICtrlMenu_GetItemDefault ( $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 ein Menüitem Identifizierer |
| True: | Item ist das Standarditem |
| False: | Item ist nicht das Standarditem |
- - - - - - - - Erklärung der Controls - - - - - - - -
#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/Setzt das Standard-Menüitem
Writeln("Öffnen ist Standard: " & _GUICtrlMenu_GetItemDefault($hFile, 1))
_GUICtrlMenu_SetItemDefault($hFile, 1)
Writeln("Öffnen ist Standard: " & _GUICtrlMenu_GetItemDefault($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