One possibility is the use of multiple monitors.
The GetSystemMetrics function returns only the value of the main monitor, so the coordinates on the other monitor may be different.
Therefore, get the resolution of the monitor where the mouse cursor is located and try it again.
Code: Select all
Define mi.MONITORINFO, pt.q
mi\cbSize = SizeOf(MONITORINFO)
bottom_of_desktop = -60000
Repeat
GetCursorPos_(@pt)
hMon = MonitorFromPoint_(pt, 0)
If hMon
If GetMonitorInfo_(hMon, mi)
bottom_of_desktop = mi\rcMonitor\bottom - 1
EndIf
EndIf
Delay(10)
If GetAsyncKeyState_(#VK_LBUTTON) & $8000 And DesktopMouseY()=bottom_of_desktop
Debug "Mouse clicked at bottom"
Repeat : Delay(1) : Until GetAsyncKeyState_(#VK_LBUTTON)=0
EndIf
ForEver
Or, if the results are different on the same monitor, it may be due to the program's delayed response, although rare.