Code: Select all
isWindowFullScreen( winTitle ) {
;checks if the specified window is full screen
winID := WinExist( winTitle )
If ( !winID )
Return false
WinGet style, Style, ahk_id %WinID%
WinGetPos ,,,winW,winH, %winTitle%
; 0x800000 is WS_BORDER.
; 0x20000000 is WS_MINIMIZE.
; no border and not minimized
Return ((style & 0x20800000) or winH < A_ScreenHeight or winW < A_ScreenWidth) ? false : true
}
Code: Select all
#Warn
#NoEnv
#SingleInstance Force
#NoTrayIcon
FormatTime, var0,, h:mm:ss tt
Gui, +AlwaysOnTop +ToolWindow -SysMenu -Caption
Gui, Color, cA0F1FD
Gui, Font, cFF0000 s10 w700, verdana
Gui, Add, Text, y0 vD, % A_MMMM " " A_DD NatSuf(A_DD) ", " A_YYYY " - " var0
Gui, Show, NoActivate x485 y530, uptime
WinGetPos X, Y, Width, Height, uptime
MaxX := A_ScreenWidth - Width - 1637
MaxY := A_ScreenHeight - Height - 75
WinMove uptime, ,%MaxX%, %MaxY% ;set window to bottom right corner
WinSet, TransColor, CCCCCC 100,uptime ;set transparency
SetTimer, RefreshD, 1000
return
RefreshD:
FormatTime, var0,, h:mm:ss tt
GuiControl,, D, % A_MMMM " " A_DD NatSuf(A_DD) ", " A_YYYY " - " var0
return
NatSuf(n) ; by VxE
{
return Mod(n + 9, 10) >= 3 || Mod(n + 89, 100) < 3 ? "th"
: Mod(n, 10) = 1 ? "st" : Mod(n, 10) = 2 ? "nd" : "rd"
}
What I have tried...
- I used a settimer to detect if it is fullscreen every 200 ms, if it is, run this gui. else nothing. (Seems to work but I later wanted to move the gui and make it remember it's old position, tried to make it work but didn't work)
After doing all this, I figured someone may know an easier way to do this. My code looked like poop after all the failed atempts lol.