I wanted to make a countdown timer without queueing the countdown message to the next line but the previous data is removed after using GUICtrlSetData. Any thoughts on how to display the previous data/message?
Here is an example:
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Global $_main = GUICreate("", 501, 313, -1, -1)
Global $g_idMemo = GUICtrlCreateEdit("", 2, 2, 496, 274, $ES_AUTOVSCROLL + $ES_READONLY + $WS_VSCROLL)
GUICtrlSetData(-1, "")
GUICtrlSetFont($g_idMemo, 9, 400, 0, "Courier New")
GUICtrlSendMsg($g_idMemo, $EM_SETREADONLY, True, 0)
GUICtrlSetBkColor($g_idMemo, 0xFFFFFF)
GUICtrlSetCursor($g_idMemo, -1)
GUISetState(@SW_SHOW)
HotKeySet('{esc}', "_close")
Func _close()
Exit
EndFunc ;==>_close
Func MemoWrite($sMessage = "")
GUICtrlSetData($g_idMemo, $sMessage & @CRLF, 1)
EndFunc ;==>MemoWrite
MemoWrite("test message 1")
Sleep(1000)
MemoWrite("test message 2")
Sleep(1000)
MemoWrite("test message 3")
Sleep(1000)
For $i = 5 to 0 Step -1
GUICtrlSetData($g_idMemo, "Program will exit in "&$i&" seconds...")
Sleep(1000)
Next
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd