我想激活某个窗口,然后将鼠标移动到相对于活动窗口客户区的位置。请参阅以下代码:
CoordMode, Mouse, Client
WinActivate, titile
MouseMove, 200, 100
当鼠标似乎没有移动时,窗口处于活动状态。但是,如果我更改代码顺序,例如:
CoordMode, Mouse, Client
MouseMove, 200, 100
WinActivate, titile
当鼠标移动时,窗口按预期激活,但相对于最后一个窗口。我无法理解。
答案 0 :(得分:0)
表演后,
WinActivate, titile
试
WinWaitActivate, titile
以便代码停止,直到窗口被激活
也尝试移动
CoordMode, Mouse, Client
WinWaitActivate命令后面的
根据您的windows / autohotkey版本,将客户端替换为相对
答案 1 :(得分:0)
您不需要等到窗口激活才能移动鼠标指针。
尝试:
; Its location doesn't matter so long as it comes before mouse movements.
CoordMode Mouse, Client
; WinExist ensures the Last Found window is updated.
WinActivate % "ahk_id " WinExist("titile")
; Better than MouseMove in a number of aspects.
SendInput {Click 200 100 0}