If you really want to get thses events in your loop you can use a Dummy control.
#include <GUIConstantsEx.au3>
#include <ListboxConstants.au3>
#include <WindowsConstants.au3>
#include <ScrollBarConstants.au3>
#include <File.au3>
#include <Timers.au3>
Dim $LogWindow=0
Func CreateLogWindow($Title,$Width,$Height)
If $LogWindow<>0 Then
MsgBox(0,"Internal Error","Log window was already created")
Return
EndIf
GUICreate($Title,$Width,$Height)
$LogWindow=GUICtrlCreateList("",5,5,$Width-10,$Height-10,$LBS_NOSEL+$WS_VSCROLL)
GUISetState()
EndFunc
Func LogString($LogText)
If $LogWindow=0 Then
MsgBox(0,"Internal Error","Log window used but not yet created")
CreateLogWindow("LogWindow",800,300)
EndIf
GUICtrlSetData($LogWindow,$LogText)
GUICtrlSendMsg($LogWindow,$WM_VSCROLL,$SB_LINEDOWN,0)
EndFunc
; Start of program
Global $Dummy
CreateLogWindow("Log",900,500)
$MainWindow=GUICreate("Test-1",370,86) ; The main window
$Button_1=GUICtrlCreateButton("Button_1",10,53)
$Button_2=GUICtrlCreateButton("Button_2",100,53)
$Exit=GUICtrlCreateButton("Cancel (Exit)",190,53)
$Dummy = GUICtrlCreateDummy()
GUISetState()
$Timer_1=_Timer_SetTimer($MainWindow,1000,"TimerCallback",-1)
LogString(@HOUR&":"&@MIN&":"&@SEC&":"&@MSEC&": Started Timer_1 1000ms")
$Timer_2=_Timer_SetTimer($MainWindow,1900,"TimerCallback",-1)
LogString(@HOUR&":"&@MIN&":"&@SEC&":"&@MSEC&": Started Timer_2 1900ms")
$cnt=0
While 1
$Msg = GUIGetMsg()
Switch $Msg
Case $Dummy
Switch GUICtrlRead($Dummy)
Case $Timer_1
LogString(@HOUR&":"&@MIN&":"&@SEC&":"&@MSEC&": Received event via Timer_1")
Case $Timer_2
LogString(@HOUR&":"&@MIN&":"&@SEC&":"&@MSEC&": Received event via Timer_2")
EndSwitch
Case $Button_1
LogString(@HOUR&":"&@MIN&":"&@SEC&":"&@MSEC&": Received Button_1 event")
Case $Button_2
LogString(@HOUR&":"&@MIN&":"&@SEC&":"&@MSEC&": Received Button_2 event")
Case $Exit
LogString(@HOUR&":"&@MIN&":"&@SEC&":"&@MSEC&": Received Exit event")
MsgBox(0,"Handling Exit event","Exiting")
Exit
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
Func TimerCallback($hWnd, $Msg, $iIDTimer, $dwTime)
GUICtrlSendToDummy($Dummy,$iIDTimer)
EndFunc