Тема: AHK: Таймер. Вывод дополнительного окна с обратным отчетом
Вот есть такой таймер. Помогите сделать отдельное окно GUI и обратным отчетом оставшегося времени.
^f2::
Gui, Destroy
Gui, +AlwaysOnTop +ToolWindow
Gui, Add, Text, vText01 x25 y92 w150 h15, Hour:
Gui, Add, Text, vText02 x25 y135 w150 h15, Min:
FormatTime, Current_Time, , HH:mm:ss tt
Gui, Add, Text, vTime x100 y200, %Current_Time%
Gui, Show, % (y := !y) ? "" : "Hide"
Gui, Add, Text, vText04 x25 y175 w150 h15, Sec:
Gui, Add, Text, vText05 x110 y72 w150 h15,
Gui, Add, Text, vText06 x110 y85 w150 h15,
Gui, Add, Button, x25 y35 w65 h29 , Start
Gui, Add, Edit, vEdit1 x25 y111 w50 h49 r1
Gui, Add, Edit, vEdit2 x25 y151 w50 h49 r1
Gui, Add, Edit, vEdit4 x25 y191 w50 h49 r1
GuiControl,, Edit1, 0
GuiControl,, Edit2, 0
GuiControl,, Edit3, 0
ControlClick, x55 y77, WinTitle
SetTimer, Loop3, 1000
Loop3:
FormatTime, Current_Time, , HH:mm:ss tt
GuiControl, , Time, %Current_Time%
Return
ButtonStart:
SoundBeep, 450, 100
Gui, Submit, NoHide
Gui, Destroy
met1:
ah:=A_Hour+edit1
am:=A_Min+edit2
as:=A_Sec+edit4
met2:
if am>60
{
am:=am-60
ah:=ah+1
goto met2
}
met3:
if as>60
{
as:=as-60
am:=am+1
goto met3
}
ah1:=ah-A_Hour
am1:=am-A_Min
as1:=as-A_Sec
GuiControl,, Text05, Start %A_Hour% %A_Min% %A_Sec%
GuiControl,, Text06, Stop %ah% %am% %as%
h:=Edit1*3600000
m:=Edit2*60000
s:=Edit4*1000
sleep %h%
sleep %m%
sleep %s%
SoundBeep, 2000, 250
SoundBeep, 2000, 650
Return
^F1::
goto, ButtonStart
Return