#include <GUIMenu.au3>
#include <WindowsConstants.au3>
HotKeySet("!{f2}", "_AutoItTest")
$hGUI = GUICreate("Test", 200, 100, -1, -1)
$hMenu = _GUICtrlMenu_GetSystemMenu($hGUI)
_GUICtrlMenu_InsertMenuItem($hMenu, 8, "&AutoIt Alt+F2", 77)
GUISetState()
GUIRegisterMsg($WM_SYSCOMMAND, "_WM_SYSCMD")
Do
Until guiGetMsg() = -3
Func _WM_SYSCMD($hWnd, $iMsg, $wparam, $lparam)
If bitAND($wparam, 0xFFFF) = 77 Then _AutoItTest()
EndFunc ;==>_WM_SYSCMD
Func _AutoItTest()
Msgbox(0, "Test", "You clicked the &AutoIt menu item.")
EndFunc ;==>_Test
|