本帖最后由 happytc 于 2011-9-8 21:02 编辑
回复 3# pdp320921
其实象这种要在死循环里跳出来,最好用一些au3提供的中断函数来做。
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
$main = GUICreate("main", 600, 400, -1, -1)
$text = GUICtrlCreateLabel("hello,world", 0, 200)
GUIRegisterMsg($WM_SYSCOMMAND, "WM_SYSCOMMAND")
GUISetState(@SW_SHOW) ;
_HelloWorld()
Func _HelloWorld()
For $i = 0 To 600 Step 20
Sleep(500)
ControlMove($main, "", 3, $i, 200)
Next
EndFunc
Func WM_SYSCOMMAND($hWnd, $Msg, $wParam, $lParam)
Local Const $SC_CLOSE = 0xF060
If $hWnd == $main Then
Switch BitAND($wParam, 0xFFF0)
Case $SC_CLOSE
Exit
EndSwitch
EndIf
Return $GUI_RUNDEFMSG
EndFunc
|