Setzt das Standard Menüitem
#include <GuiMenu.au3>
_GUICtrlMenu_SetMenuDefaultItem ( $hMenu, $iItem [, $bByPos = True] )
| $hMenu | Menühandle |
| $iItem | ID oder Position des Standardmenüitems oder -1 für kein Standarditem |
| $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_GetMenuDefaultItem
Suche nach SetMenuDefaultItem in der MSDN Bibliothek.
#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 den Standard-Menüpunkt für das Menü Datei
Writeln("Standard-Menüpunkt für das Menü Datei: " & _GUICtrlMenu_GetMenuDefaultItem($hFile))
_GUICtrlMenu_SetMenuDefaultItem($hFile, 1)
Writeln("Standard-Menüpunkt für das Menü Datei: " & _GUICtrlMenu_GetMenuDefaultItem($hFile))
_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