Autohotkey 获取当前活动的宽度 child window
Autohotkey get width of current active child window
我正在尝试编写一个脚本,将鼠标光标移动到活动中心 child window。
WinGetActiveStats, Title, Width, Height, X, Y
MouseMove, Width / 2, Height / 2, 0
以上是主要 window 的技巧。但是,我似乎无法找到一种方法来获取活动 child window 的宽度和高度,以便我可以将鼠标光标移动到 child [=25= 的中心].
与 AutoCAD 等软件一起使用时,这是一个非常有用的功能,您可以在任何给定时刻打开多个 child window。
谢谢,
以下应该有效:
ControlGetFocus, cr, A ; get the focused(active) control(child window) of the active window
ControlGetPos, x, y, width, Height, %cr%, A ; get the position and dimensions of this control
MouseMove, % x + Width / 2, % y + Height / 2, 0
我正在尝试编写一个脚本,将鼠标光标移动到活动中心 child window。
WinGetActiveStats, Title, Width, Height, X, Y
MouseMove, Width / 2, Height / 2, 0
以上是主要 window 的技巧。但是,我似乎无法找到一种方法来获取活动 child window 的宽度和高度,以便我可以将鼠标光标移动到 child [=25= 的中心].
与 AutoCAD 等软件一起使用时,这是一个非常有用的功能,您可以在任何给定时刻打开多个 child window。
谢谢,
以下应该有效:
ControlGetFocus, cr, A ; get the focused(active) control(child window) of the active window
ControlGetPos, x, y, width, Height, %cr%, A ; get the position and dimensions of this control
MouseMove, % x + Width / 2, % y + Height / 2, 0