The handle of the window to access.
The handle of the control to get the position for.
The position of the control as a Rect
object.
import { ControlGetPosByHandle, ControlGetHandle, WinGetHandle } from '@ahmic/autoit-js';
const windowHandle = WinGetHandle('Untitled - Notepad');
const controlHandle = ControlGetHandle(windowHandle, 'Edit1');
const rect = ControlGetPosByHandle(windowHandle, controlHandle);
console.log(rect); // Output: { left: 10, top: 10, right: 100, bottom: 100 }
Gets the position of a control in a window, relative to the window itself.