确实有添加Opt事件,没效果,我是WIN10
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Opt("GUIOnEventMode", 1)
$Form1 = GUICreate("Form1", 615, 437, 192, 124)
$MenuItem2 = GUICtrlCreateMenu("MenuItem2")
GUICtrlSetOnEvent(-1, "MenuItem2Click")
$MenuItem1 = GUICtrlCreateMenu("MenuItem1")
GUICtrlSetOnEvent(-1, "MenuItem1Click")
GUISetOnEvent($GUI_EVENT_CLOSE, "Form1Close")
GUISetOnEvent($GUI_EVENT_MINIMIZE, "Form1Minimize")
GUISetOnEvent($GUI_EVENT_MAXIMIZE, "Form1Maximize")
GUISetOnEvent($GUI_EVENT_RESTORE, "Form1Restore")
GUISetState(@SW_SHOW)
While 1
Sleep(100)
WEnd
Func Form1Close()
Exit
EndFunc
Func Form1Maximize()
EndFunc
Func Form1Minimize()
EndFunc
Func Form1Restore()
EndFunc
Func MenuItem1Click()
MsgBox(0, '', 'MenuItem1Click')
EndFunc
Func MenuItem2Click()
MsgBox(0, '', 'MenuItem2Click')
EndFunc
|