乱七八糟的一段代码Dim $P = RegRead('HKLM\SOFTWARE\AutoIt v3\AutoIt', 'InstallDir')
Dim $Ico = $P & '\Aut2Exe\Icons\strawberry.ico'
GUICreate('test', 400, 640)
$cIco = GUICtrlCreateIcon($Ico, -1, 10, 10)
$dIco = GUICtrlCreateIcon($Ico, -1, 250, 10)
GUISetState()
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case -3
Exit
Case $cIco
heart_1()
Case $dIco
heart_2()
EndSwitch
WEnd
Func heart_1()
For $i = 0 To 60
GUICtrlSetPos($cIco, 10 + $i * 3, 10 + 4.9 * 0.03 * ($i + 1) ^ 2)
Sleep(30)
Next
Sleep(20)
For $i = 60 To 0 Step -1
GUICtrlSetPos($cIco, 10 + $i * 3, 10 + 4.9 * 0.03 * ($i + 1) ^ 2)
Sleep(30)
Next
EndFunc
Func heart_2()
Dim $H[22] = [0, 0, 15, 30, 41, 52, 62, 70, 77, 83, 88, 92, 95, 97, 99, 101, 102, 103, 104, 104, 104, 104]
For $j = 1 To 21
If mod($j, 2) <> 0 Then
Sleep(Round(200/$j))
For $i = $H[$j] To 105
Sleep(10)
GUICtrlSetPos($dIco, 250, 10 + 4.9 * 0.01 * ($i + 1) ^ 2)
Next
Else
For $i = 105 To $H[$j] Step -1
Sleep(10)
GUICtrlSetPos($dIco, 250, 10 + 4.9 * 0.01 * ($i + 1) ^ 2)
Next
EndIf
Next
EndFunc
|