Function ControlMoveByHandle

  • Moves and resizes a control in a window.

    Parameters

    • windowHandle: bigint

      The handle of the window to access.

    • controlHandle: bigint

      The handle of the control to move or resize.

    • x: number

      The new X coordinate of the control.

    • y: number

      The new Y coordinate of the control.

    • width: number = -1

      The new width of the control. Default is -1 (no change).

    • height: number = -1

      The new height of the control. Default is -1 (no change).

    Returns number

    1 if successful, 0 otherwise.

    import { ControlMoveByHandle, ControlGetHandle, WinGetHandle } from '@ahmic/autoit-js';

    const windowHandle = WinGetHandle('Untitled - Notepad');
    const controlHandle = ControlGetHandle(windowHandle, 'Edit1');

    ControlMoveByHandle(windowHandle, controlHandle, 100, 100, 200, 50);