that looks weird.
i found a typo, if that not solves it, i´m out of options
Code:
spotstate := 1
Gui -Caption +AlwaysOnTop +LastFound +ToolWindow
Gui, Color, 0x000000, 0x000000
WinGet, IDvar , ID
SysGet, V_ScreenX, 76
SysGet, V_ScreenY, 77
SysGet, V_ScreenWidth, 78
SysGet, V_ScreenHeight, 79
PolygonP1 := V_ScreenX . "-" . V_ScreenY . " "
gosub, MakePolygonP2
PolygonP3 := V_ScreenX . "-" . V_ScreenY . " " . V_ScreenX . "-" . V_ScreenHeight . " " . V_ScreenWidth . "-" . V_ScreenHeight . " " . V_ScreenWidth . "-" . V_ScreenY . " " . V_ScreenX . "-" . V_ScreenY
MakeSingle:
activestart := WinActive("A")
Gui, Show, x%V_ScreenX% y%V_ScreenY% h%V_ScreenHeight% w%V_ScreenWidth%
WinActivate, ahk_id %activestart%
loop
{
gosub, MakePolygonP2
Polygon := PolygonP1 . PolygonP2 . PolygonP3
WinSet, Region, %Polygon%, ahk_id %IDvar%
IfWinNotExist ahk_class #32771
Gui +AlwaysOnTop
sleep, 10
if (spotstate != 1)
break
}
return
~^!s::
spotstate := !spotstate
if (spotstate = 0)
Gui, Hide
else
SetTimer, MakeSingle, -1
return
Esc::ExitApp
MakePolygonP2:
WinGetActiveStats, Title, Width, Height, X, Y
PolygonP2 := X . "-" . Y . " " . X . "-" . Y + Height . " " . X + Width . "-" . Y + Height . " " . X + Width . "-" . Y . " " . X . "-" . Y . " "
return