(Script to keep a static ish video or image moving about slitghtly randomly on one screen to avoid burnin.)
Code: Select all
#Requires AutoHotkey v1
offset := 100 ; Distance (pixels) to move the window
freq := 60000 * MINS := 10 ; Frequency of moving the window
monNum := 3 ; Monitor number
down := -1
SysGet, mon, MonitorWorkArea, monNum ; Get the monitor's working area
Process, Priority,, B
MsgBox, 64, Instructions, Press CTRL-F3 to select the active window to move
^F3:: ; CTRL-F3 = Select the window to move
WinGetActiveTitle, title
wTitle := "ahk_id" WinActive("A") ; Define the WinTitle
MsgBox, 64, Window, Your window is:`n`n%title%
SetTimer, Move, % freq
Return
Move:
If WinExist(wTitle) {
SoundBeep, 1900
down := -down
WinGetPos, x, y, w, h
x += down * offset
y += down * offset
(x + w > monRight ) && x := monRight - w
(x < monLeft ) && x := monLeft
(y + h > monBottom) && y := monBottom - h
(y < monTop ) && y := monTop
(x + w > monRight ) && w := monRight - x
(y + h > monBottom) && h := monBottom - y
WinRestore
WinMove,,, x, y, w, h
} Else {
SetTimer,, Off
SoundBeep, 1000
}
Return
monNum := 3
Can someone shed some light on what might be the issue? Would be great to get this working on correct screen.