Guest User

Countdown Overlay

a guest
Sep 7th, 2022
40
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #NoEnv
  2. #SingleInstance, Force
  3. SetBatchLines, -1
  4.  
  5. ; ---------------------- PROJECT CODE BELOW ----------------------
  6.  
  7. Menu, Tray, Icon, Shell32.dll, 3 ; Custom Icon pulled from Shell32
  8. Menu, tray, tip, %A_ScriptName% ; Custom traytip
  9.  
  10. Gui, GUI_Overlay:New, +ToolWindow +LastFound +AlwaysOnTop -Caption +hwndGUI_Overlay_hwnd
  11. Gui, Margin, 10, 10
  12. Gui, Font, s40 q4, Segoe UI Bold
  13. Gui, Add, Text, w400 Center vTEXT_Timer cWhite, %timerCount% seconds
  14. Gui, Color, 000000
  15. WinSet, Transparent, 200
  16.  
  17. ; Trigger hotkey
  18. 2::
  19.     timerCount := 20 ; Change me
  20.     GuiControl, GUI_Overlay:, TEXT_Timer, %timerCount% seconds
  21.     Gui, GUI_Overlay:Show, x20 y20 NoActivate
  22.     SetTimer, Timer_Countdown, 1000
  23. return
  24.  
  25. ; Does the countdown and updating of the timer
  26. Timer_Countdown:
  27.     if (timerCount == 1) {
  28.         SetTimer, Timer_Countdown, Off
  29.         Gui, Gui_Overlay:Hide
  30.     }
  31.     timerCount--
  32.     GuiControl, GUI_Overlay:, TEXT_Timer, %timerCount% seconds
  33. return
  34.  
  35. Esc::
  36. ExitApp
Advertisement
Add Comment
Please, Sign In to add comment