OffTopic:
Alofa, все ок.
Alofa, все ок.
Добавлено:
Сообщение автоматически объединено:
Да, ну конечно самое "красивое" решение данной темы считаю вот этим (использование GUICtrlCreateDummy, GUICtrlSendToDummy и таймера):
Код:
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <StaticConstants.au3>
Opt("GUIOnEventMode", 1) ; Включить режим отслеживания событий GUI.
; ====================================================================================================================
; Создаем визуальное окно и объекты в нем.
; ====================================================================================================================
; Создать визуальное окно.
$WINGUI = GUICreate("TEST", 470, 245, -1, -1, BitOr($WS_POPUP, $WS_BORDER))
; Информауионные строки.
$lbTMR1 = GUICtrlCreateLabel("TMR1:", 10, 10, 40, 15, $SS_LEFTNOWORDWRAP, $GUI_WS_EX_PARENTDRAG)
$lbTMR2 = GUICtrlCreateLabel("TMR2:", 10, 25, 40, 15, $SS_LEFTNOWORDWRAP, $GUI_WS_EX_PARENTDRAG)
$lbTMR3 = GUICtrlCreateLabel("TMR3:", 10, 40, 40, 15, $SS_LEFTNOWORDWRAP, $GUI_WS_EX_PARENTDRAG)
$lbTMR4 = GUICtrlCreateLabel("TMR4:", 10, 55, 40, 15, $SS_LEFTNOWORDWRAP, $GUI_WS_EX_PARENTDRAG)
$idTMR1 = GUICtrlCreateLabel("0", 55, 10, 65, 15, $SS_LEFTNOWORDWRAP, $GUI_WS_EX_PARENTDRAG)
$idTMR2 = GUICtrlCreateLabel("0", 55, 25, 65, 15, $SS_LEFTNOWORDWRAP, $GUI_WS_EX_PARENTDRAG)
$idTMR3 = GUICtrlCreateLabel("0", 55, 40, 65, 15, $SS_LEFTNOWORDWRAP, $GUI_WS_EX_PARENTDRAG)
$idTMR4 = GUICtrlCreateLabel("0", 55, 55, 65, 15, $SS_LEFTNOWORDWRAP, $GUI_WS_EX_PARENTDRAG)
; Кнопки.
GUICtrlCreateButton("TMR1", 260, 70, 100, 25)
GUICtrlSetOnEvent(-1, "_TMR1")
GUICtrlCreateButton("TMR2", 260, 95, 100, 25)
GUICtrlSetOnEvent(-1, "_TMR2")
GUICtrlCreateButton("TMR3", 260, 120, 100, 25)
GUICtrlSetOnEvent(-1, "_TMR3")
$BTDUMMY = GUICtrlCreateDummy()
GUICtrlSetOnEvent(-1, "_TMR4")
; Системные события.
GUISetOnEvent($GUI_EVENT_CLOSE, "_CLOSEEvent")
GUISetState(@SW_SHOW, $WINGUI)
Global $TMRUPDATE = TimerInit()
While 1
If TimerDiff($TMRUPDATE) > 100 Then
$TMRUPDATE = TimerInit()
GUICtrlSendToDummy($BTDUMMY)
EndIf
WEnd
Func _TMR1()
For $TMR1 = 1 To 5
GUICtrlSetData ($idTMR1, $TMR1)
sleep (500)
Next
EndFunc
Func _TMR2()
For $TMR2 = 1 To 5
GUICtrlSetData ($idTMR2, $TMR2)
sleep (500)
Next
EndFunc
Func _TMR3()
For $TMR3 = 1 To 5
GUICtrlSetData ($idTMR3, $TMR3)
sleep (500)
Next
EndFunc
Func _TMR4()
For $TMR4 = 1 To 5
GUICtrlSetData ($idTMR4, $TMR4)
sleep (500)
Next
EndFunc
; ====================================================================================================================
; Функции системных событий.
; ====================================================================================================================
Func _CLOSEEvent()
Exit
EndFunc