-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathguiEvent_LoopMsg.au3
42 lines (32 loc) · 985 Bytes
/
guiEvent_LoopMsg.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
33
34
35
36
37
38
39
40
41
42
#include <GUIConstantsEx.au3>
GUICreate("Hello World",200,100)
GUICtrlCreateLabel("Hello! How are you?", 30, 10)
$okButton = GUICtrlCreateButton("OK", 70, 50, 60)
GUISetState(@SW_SHOW)
While 1
$msg = GUIGetMsg()
Select
Case $msg = $okButton
MsgBox(0, "GUI EVENT", "You pressed OK!")
Case $msg = $GUI_EVENT_CLOSE
MsgBox(0, "GUI EVENT", "You clicked Close! Exiting...")
ExitLoop
EndSelect
WEnd
$mainWindow = GUICreate("Hello World", 200, 100)
GUICtrlCreateLabel("Hello! How are you?", 30, 10)
$okButton = GUICtrlCreateButton("OK", 70, 50, 60)
$dummywindow = GUICreate("Dummy window for testing", 200, 100, -1, 100)
GUISetState(@SW_SHOW, $dummywindow)
GUISwitch($mainWindow)
GUISetState()
While 1
$msg = GUIGetMsg(1)
Select
Case $msg[0] = $okButton
MsgBox(0, "GUI EVENT", " You pressed OK!")
Case $msg[0] = $GUI_EVENT_CLOSE And $msg[1] = $mainWindow
MsgBox(0, "GUI EVENT", "You clicked Close on the Main Window! Exiting...")
ExitLoop
EndSelect
WEnd