关闭后自动询问
怎么能够让 用户在 点完这个按钮之后 弹出一个询问 然后点 是 或者 否 再执行其他操作呢?请各位朋友帮帮忙! 应该是再加一个条件语句吧 怎么加呢点关闭的时候弹出来就好! 楼主看一下msgbox的返回值 #include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
$Form1 = GUICreate("Form1", 312, 197, 192, 114)
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
$m = MsgBox(36, '提示', '你想干嘛')
Switch $m
Case 6
MsgBox(0, 0, '你点击了是!')
Case 7
MsgBox(0, 0, '你点击了否!')
EndSwitch
EndSwitch
WEnd
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case -3 ;或者是$GUI_Event_Close
Switch $msgbox = MsgBox(4,"title","content")
Case 6
;此处添加点击“是”后执行的语句
Case 7
;此处添加点击“否”后执行的语句
EndSwitch
EndSwitch自己对应着把上面的代码插入到脚本里。 没有明白楼主的意思! 回复 8# sliqi
好好看看楼主问的问题,5、6楼的回答没有错吧,平心静气! 回复qzdisk
5楼 6楼 给我好好的看看帮助去。
If MsgBox(1+64, "提示" , "确定要退出吗 ...
sliqi 发表于 2011-12-9 13:17 http://www.autoitx.com/images/common/back.gif
我们一般关掉程序都是 关右上角 那个打×用什么来判断 触发这个 msgbox这个函数! 我们一般关掉程序都是 关右上角 那个打×用什么来判断 触发这个 msgbox这个函数!
qzdisk 发表于 2011-12-9 13:57 http://www.autoitx.com/images/common/back.gif
5 楼已经回答你了 8#,我还没有看懂你的....但,我却测试了 5# 的 ,没错啊@! OnAutoItExitRegister("Func_EXIT")
func Func_EXIT()
local $ifexit=msgbox(1,"提示","是否真要退出?")
if $ifexit=1 then
exit
else
XXXXXXXXXXXXXXXXX;不知道怎么写了
endfunc 回复 10# qzdisk
$GUI_EVENT_CLOSE 过来围观学习一下! 回复 13# nivisde
关闭GUI不等于退出Autoit
页:
[1]