I'm making a script for 2 differents windows, and when I click on the first window, a click in the same position in the other window occurs.
The problem is, my script make the click but the x
axis on the second window is always 0
... and I don't know why
Maybe you got a solution or another way to script it?
This is my script:
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
#Warn ; Recommended for catching common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
;retrouver les id de 2 fenetres
WinGet, first_id, ID, window1
WinGet, sec_id, ID, window2
;activation des fenetres
WinActivate, ahk_id %sec_id%
WinActivate, ahk_id %first_id%
; fonction pour quitter la macro
~Esc::ExitApp
return
;test repeter clic souris
;LeftClic
~LButton::
{
MouseGetPos, xposi, yposi
ControlClick, x%xposi% y%yposi%, ahk_id %first_id%,,LEFT
WinActivate, ahk_id %sec_id%
ControlClick, x%xposi% y%yposi%, ahk_id %sec_id%,,LEFT
WinActivate, ahk_id %first_id%
MouseMove, xposi, yposi
}
return