CoordMode needs a pause to update
Posted: 17 Oct 2017, 15:30
I was testing some code relating to CoordMode: client/screen/window, and noticed that A_CaretX and A_CaretY were not updating unless I added a pause after using the CoordMode command.
Perhaps this is similar in nature to an issue where DetectHiddenWindows did not update immediately.
DetectHiddenWindows bug? - AutoHotkey Community
https://autohotkey.com/boards/viewtopic ... 14&t=30010
Perhaps this is similar in nature to an issue where DetectHiddenWindows did not update immediately.
DetectHiddenWindows bug? - AutoHotkey Community
https://autohotkey.com/boards/viewtopic ... 14&t=30010
Code: Select all
q:: ;CoordMode needs a pause to update
WinGet, hWnd, ID, A
vOutput := ""
vSleep := 0 ;incorrect: all results will be the same
;vSleep := 1 ;correct: results will vary
vList := "Client,Screen,Window"
Loop, Parse, vList, % ","
{
CoordMode, Caret, % A_LoopField
Sleep, % vSleep
vOutput .= (A_Index=1?"":"`r`n") A_CaretX " " A_CaretY
}
MsgBox, % vOutput
return