-
Notifications
You must be signed in to change notification settings - Fork 0
/
gui_learn.au3
33 lines (27 loc) · 990 Bytes
/
gui_learn.au3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include <Constants.au3>
#include <GUIConstantsEx.au3>
#include <MsgBoxConstants.au3>
#include <WindowsConstants.au3>
Example()
Func Example()
Local $iOldOpt = Opt("GUICoordMode", 1)
Local $hGUI = GUICreate("My GUI icon Race", 350, 74, -1, -1)
GUICtrlCreateLabel("", 331, 0, 1, 74, 5)
Local $idIcon1 = GUICtrlCreateIcon(@ScriptDir & '\Extras\dinosaur.ani', -1, 0, 0, 32, 32)
Local $idIcon2 = GUICtrlCreateIcon(@ScriptDir & '\Extras\horse.ani', -1, 0, 40, 32, 32)
GUISetState(@SW_SHOW)
Local $a = 0, $b = 0
While ($a < 300) And ($b < 300)
$a += Random(0, 1, 1)
$b += Random(0, 1, 1)
GUICtrlSetPos($idIcon1, $a, 0)
GUICtrlSetPos($idIcon2, $b, 40)
Sleep(10)
WEnd
Opt("GUICoordMode", $iOldOpt)
If $a > $b Then
MsgBox($MB_SYSTEMMODAL, 'Race results', 'The dinosaur won', 0, $hGUI)
Else
MsgBox($MB_SYSTEMMODAL, 'Race results', 'The horse won', 0, $hGUI)
EndIf
EndFunc ;==>Example