@ahmic/autoit-js
    Preparing search index...

    Function ControlGetPosByHandleSync

    • Gets the position of a control in a window, relative to the window itself.

      Parameters

      • windowHandle: bigint

        The handle of the window to access.

      • controlHandle: bigint

        The handle of the control to get the position for.

      Returns IRect

      The position of the control as a Rect object.

      import { ControlGetPosByHandleSync, ControlGetHandleSync, WinGetHandleSync } from '@ahmic/autoit-js';

      const windowHandle = WinGetHandleSync('Untitled - Notepad');
      const controlHandle = ControlGetHandleSync(windowHandle, 'Edit1');

      const rect = ControlGetPosByHandleSync(windowHandle, controlHandle);

      console.log(rect); // Output: { left: 10, top: 10, right: 100, bottom: 100 }