上来就看见afan出了个好题,好玩就做了一个,按一下就不停的跳,再按一下停止,挺好玩的,哈哈~~
代码:Dim $P = RegRead('HKLM\SOFTWARE\AutoIt v3\AutoIt', 'InstallDir')
Dim $Ico = $P & '\Aut2Exe\Icons\strawberry.ico'
GUICreate('test', 350, 130)
$cIco = GUICtrlCreateIcon($Ico, -1, 100, 50,32,32)
GUISetState()
$f=1
$g=0
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case -3
Exit
Case $cIco
;~ Msgbox(0, 0, '让心跳动起来')
$t=TimerInit ()
$g = Not $g
While $g
$nMsg = GUIGetMsg()
If $nMsg == -3 Then Exit
If $nMsg == $cIco Then
If $g Then MsgBox (0,"","你干嘛,会死人的!")
$g = Not $g
EndIf
$time = Round ( TimerDiff($t)/1000,1)*10
$jump = Mod ( $time, 10)
If $jump == 0 Then
GUICtrlDelete ($cIco)
$cIco = GUICtrlCreateIcon($Ico, -1, 95, 45,42,42)
Sleep (80)
GUICtrlDelete ($cIco)
$cIco = GUICtrlCreateIcon($Ico, -1, 100, 50,32,32)
EndIf
WEnd
EndSwitch
WEnd
|