循环用 while就行了,
这是利用MsgBox
返回值:
OK(确定) 1
CANCEL(取消) 2While 1
$Flag = MsgBox(1, "", "")
If $Flag = 1 Then
Exit
ElseIf $Flag = 2 Then
MsgBox(16, "", "")
EndIf
WEnd
这是自己建立窗口#NoTrayIcon
#include <GUIConstants.au3>
$Form1 = GUICreate("", 200, 100 - 1, -1)
$Button1 = GUICtrlCreateButton("確定", 40, 20, 120, 25, 0)
$Button2 = GUICtrlCreateButton("取消", 40, 50, 120, 25, 0)
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
MsgBox(16, "", "")
ContinueLoop
Case $Button1
Exit
Case $Button2
MsgBox(16, "", "")
EndSwitch
WEnd
|