It has a GUI that displays the remaining time until the next notification.
However, I've encountered an issue where the GUI takes focus every time it updates the remaining time, making it impossible for me to work on any other window.
I've tried for over 8 hours to resolve this issue but I haven't been able to find a solution.
I would greatly appreciate any suggestions or advice on how to make the GUI behave like any regular window, remaining unnoticed unless I need to check it.
I am open to every possible solution, including a complete change of the approach if necessary.
I run Version 1.1.36.02
Thank you in advance for your time and help.
Code: Select all
counter = 0
Alarm() {
global counter
counter := 0
Sleep, 500
SoundPlay, alarm.wav
Sleep, 500
Run, alarm.ahk
Sleep, 500
ExitApp
}
TrackTime() {
global counter
counter++
if (counter >= 1200) { ; 15 minutes in seconds
counter := 0
Alarm()
}
minutes_remaining := Floor((1200-counter)/60) ; convert to minutes
seconds_remaining := Mod(1200-counter, 60) ; calculate remaining seconds
if (seconds_remaining < 10) {
seconds_remaining := "0" . seconds_remaining
}
Gui, Add, Text, x7 y7, Time Remaining: %minutes_remaining%:%seconds_remaining%
Gui, Show, x0 y1030
Gui, +LastFound
}
Gui, Destroy
SetTimer, TrackTime, 1000
SetTimer, Alarm, 1200000
return