Skip to content

Instantly share code, notes, and snippets.

Created September 2, 2013 03:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anonymous/6409072 to your computer and use it in GitHub Desktop.
Save anonymous/6409072 to your computer and use it in GitHub Desktop.
^1::
IfWinExist ahk_id %MyGuiHwnd%
{
gosub move_GUI
return
}
Gui +HwndMyGuiHwnd
initSecs := 10
Gui, +AlwaysOnTop
Gui, font,s10 bold,Verdana
Gui, +Caption +Border -sysmenu
Gui, add, text, x10 y10 w100 h50 center vTX , %initSecs%
Gui, Show, w120 h30 x1081 y0,Time of Presentation
GoSub TimerCountDown
SetTimer, TimerCountDown, 1000
return
TimerCountDown:
If increase=
GuiControl,,TX,% Frmt(--initSecs)
else
GuiControl,,TX,% Frmt(++initSecs)
if initSecs <= 5
{
increase=
SoundPlay, D:\Dew.wav
Gui, Font, cBlue
GuiControl, Font, TX,
GoSub, Timer2
}
return
Timer2:
If increase=
Gui, Font, cBlue
else
Gui, Font, cBlue
If initsecs <= 0
{
increase=1
GoSub, TimeReachedZero
}
else if (initsecs = 5) AND (increase <> 1)
GoSub, FiveSecsLeft
else if (inisecs = 5 * 60000) ;five minutes
GoSub, FiveMinutesSinceZero
Return
TimeReachedZero:
Gui, Font, cRed
Return
FiveSecsLeft:
Return
FiveMinutesSinceZero:
Return
move_gui:
i ++
if i = 1
GUI, show, x0 y0
else if i = 2
GUI, show, % "x" A_ScreenWidth - 185 "y" 0
else if i = 3
GUI, show, % "x" A_ScreenWidth - 185 "y" A_ScreenHeight - 90
else if i = 4
GUI, show, % "x" 0 "y" A_ScreenHeight - 90
else
{
GUI, show, center
i = 0 ; reset the counter
}
return
GuiClose:
MyGuiHwnd := "" ; reset the GUI ID
Gui, Destroy
return
Frmt(secs) {
time = 20000101
time += %secs%, seconds
FormatTime, mmss, %time%, HH:mm:ss
return mmss
}
^F12::Pause
^F9::
SetTimer, TimerCountDown, off
initSecs = 15
Gui, Font, cBlack
GuiControl, Font, TX,
GuiControl,,TX,00:00:00
increase:=
SetTimer, TimerCountDown, 1000
return
^Insert::ExitApp
; ถ้าสงสัยอะไรถามผมอีกทีละกานนน
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment