Sets the menu item ID
#include <GuiMenu.au3>
_GUICtrlMenu_SetItemID ( $hMenu, $iItem, $iID [, $bByPos = True] )
$hMenu | Menu handle |
$iItem | Identifier or position of the menu item |
$iID | Menu item ID |
$bByPos | [optional] Menu identifier flag: True - $iItem is a 0-based item position False - $iItem is a menu item identifier |
Success: | True. |
Failure: | False. |
#include <GuiMenu.au3>
Example()
Func Example()
Local $hWnd, $hMain, $hFile
; Open Notepad
Run("notepad.exe")
WinWaitActive("[CLASS:Notepad]")
$hWnd = WinGetHandle("[CLASS:Notepad]")
$hMain = _GUICtrlMenu_GetMenu($hWnd)
$hFile = _GUICtrlMenu_GetItemSubMenu($hMain, 0)
; Get/Set Open command ID
Writeln("Open command ID: " & _GUICtrlMenu_GetItemID($hFile, 1))
_GUICtrlMenu_SetItemID($hFile, 1, 0)
Writeln("Open command ID: " & _GUICtrlMenu_GetItemID($hFile, 1))
EndFunc ;==>Example
; Write a line of text to Notepad
Func Writeln($sText)
ControlSend("[CLASS:Notepad]", "", "Edit1", $sText & @CRLF)
EndFunc ;==>Writeln