I made a simple timer using Autohotkey with the help of some snippets from the Autohotkey forum, Like the page loading bar on many of the web pages in browser, but for Windows.
Now it work as expected, with those features:
- Stay on top of the Screen
- Take up very little Screen Space (4px height only)
- Clik Through and Tranasparent (won't stop me from mouse over top right corner to close a window)
- Simple enough, just change the .ahk code to config color, time, size etc.
But, I notice while transparency been set to 100, there alway be a gray transparent background,
Some one know any parameter I can tweak to make the progress bar without background ?
Full Autohotkey code here for this simple timer:
#Persistent
WinTitle = toptimer
Gui,New,hwndMyGui
global MyProgress
; 30 minutes
time := 30 * 60 * 1000
tick:=A_TickCount+time
Gui, +E0x20 -Caption +AlwaysOnTop +Owner +LastFound
; Gui, -Caption +AlwaysOnTop +Owner +LastFound
WinSet, Transparent, 100
; Gui,Margin,0,0
Gui,Margin,-1,-1
Gui,Add,Progress,w1920 h4 cbFF0000 Range%A_TickCount%-%tick% vMyProgress
; Gui,Show,NA
Gui, Show, x0 y0 w%A_ScreenWidth%
While A_TickCount<=tick {
GuiControl,,MyProgress,% A_TickCount
Sleep 16
}
Gui,Destroy
ExitApp
Thanks @0x464e for nice suggestion,
Now I just draw a single color gui and change it's width
#Persistent
Gui,New,hwndMyGui
time := 1 * 60 * 1000
tick:=A_TickCount+time
Gui, +E0x20 -Caption +AlwaysOnTop +Owner +LastFound
WinSet, Transparent, 100
Gui, Color, FF0000
While A_TickCount<=tick {
width0 := A_ScreenWidth * (1 - (tick - A_TickCount)/time)
Gui, Show, x0 y0 w%width0% h5
Sleep 16
}
Gui,Destroy
ExitApp
That made the code even simpler, and the background is gone. But while this timer is running, the left mouse button is not function right, clicking on explorer's top right Minimize/Restore/Close is not work.
But the Minimize/Restore/Close button of vscode is working fine.
After quit the timer, everything just work fine.
Some one help to figure out why that happens.