映射菜单快捷键到它的菜单位置
#Include <GuiMenu.au3>
_GUICtrlMenu_MapAccelerator($hMenu, $cAccel)
| $hMenu | 菜单句柄 | 
| $cAccel | 快捷键 | 
| 成功: | 返回菜单项目的 0 基位置 | 
| 失败: | 返回 -1 | 
#include <GuiMenu.au3>
_Main()
Func _Main()
    Local $hWnd, $hMain, $hFile
    ; 打开记事本
    Run("notepad.exe")
    WinWaitActive("[CLASS:Notepad]")
    $hWnd = WinGetHandle("[CLASS:Notepad]")
    $hMain = _GUICtrlMenu_GetMenu($hWnd)
    $hFile = _GUICtrlMenu_GetItemSubMenu($hMain, 0)
    ; Map Open accelerator ID
    Writeln("Open command ID: " & _GUICtrlMenu_MapAccelerator($hFile, "O"))
EndFunc   ;==>_Main
; 写入一行文本到记事本
Func Writeln($sText)
    ControlSend("[CLASS:Notepad]", "", "Edit1", $sText & @CR)
EndFunc   ;==>Writeln