回复 1# zuiyi
试试用AdlibRegister和AdlibUnRegister代替Sleep.
不一定能用,这个看你代码怎么写.
#include <GUIConstantsEx.au3>
Opt('MustDeclareVars', 1)
Example()
Func Example()
Local $parent1, $ok1, $cancel1
Opt("GUICoordMode", 2)
Opt("GUIResizeMode", 1)
Opt("GUIOnEventMode", 1)
$parent1 = GUICreate("父窗 1")
GUISetOnEvent($GUI_EVENT_CLOSE, "SpecialEvents")
GUISetOnEvent($GUI_EVENT_MINIMIZE, "SpecialEvents")
GUISetOnEvent($GUI_EVENT_RESTORE, "SpecialEvents")
$ok1 = GUICtrlCreateButton("确定", 10, 30, 50)
GUICtrlSetOnEvent(-1, "OKPressed")
$cancel1 = GUICtrlCreateButton("删除", 0, -1)
GUICtrlSetOnEvent(-1, "CancelPressed")
GUISetState(@SW_SHOW)
; 仅虚度时光
While 1
Sleep(10)
WEnd
EndFunc ;==>Example
Func OKPressed()
SplashTextOn("标题", "文本")
AdlibRegister("_Sleep", 5000)
EndFunc ;==>OKPressed
Func CancelPressed()
SplashOff()
AdlibUnRegister("_Sleep")
EndFunc ;==>CancelPressed
Func SpecialEvents()
If @GUI_CtrlId = $GUI_EVENT_CLOSE Then Exit
EndFunc ;==>SpecialEvents
Func _Sleep()
SplashOff()
AdlibUnRegister("_Sleep")
EndFunc ;==>_Sleep
|