Autoit WindowFunctions

Last Updated:

Actions for working with Window objects


[How To Read This Reference]
CloseWindow
AUT
Sends a Close command to the active window.
Maximize
AUT
Sends a WMaximize command to the active window.
Minimize
AUT
Sends a WMinimize command to the active window.
Restore
AUT
Sends a RestorePos command to the active window.
SetPosition
AUT
Sends a SetPosition command to the window to set the position, size, and status of the window.

Autoit WindowFunctions::CloseWindow
AUT

Sends a Close command to the active window.

This Window command has a problem in that it does not want to use the same recognition methods used by the other Window commands (like SetContext). Particularly, it does not accept the Type=Window portion of these recognition methods. In addition, if the window is a child window of a parent then it expects the ";ChildWindow" add-on in the recognition method. The child may also need the parent as part of its full recognition string like:

ChildWindow=Type=Window;<parent rec>;\;Caption=<caption>;ChildWindow

To handle these child windows, we parse the typical recognition method for our window and attempt to handle these issues. Once SetContext has successfully set our window, we then remove any "Type=Window" substring if present and add the ";ChildWindow" substring if not present.

To take advantage of this, this routine must be called with the child window as a component of the parent window like below:

t, ParentWindow, ChildWindow, CloseWindow

If the routine is called like either of the examples below then default processing will occur. This will merely SetContext on the provided Window and use "CurrentWindow" as the parameter to the command.

t, ParentWindow, ParentWindow, CloseWindow
t, ChildWindow , ChildWindow , CloseWindow (normally won't work)

Closes the "current" or "lastUsed" WebDriver associated with the found Window component.


Fields: [ ]=Optional with Default Value
    Examples:
    • T, WINDOW, WINDOW, CLOSEWINDOW
      Sends a CloseWindow command to the specified Window

      Sends a CloseWindow command to the specified Window

    [How To Read This Reference]

    Autoit WindowFunctions::Maximize
    AUT

    Sends a WMaximize command to the active window.

    Sends a WMaximize command to the active window.

    This Window command has a problem in that it does not want to use the same recognition methods used by the other Window commands (like SetContext). Particularly, it does not accept the Type=Window portion of these recognition methods. In addition, if the window is a child window of a parent then it expects the ";ChildWindow" add-on in the recognition method. The child may also need the parent as part of its full recognition string like:

    ChildWindow=Type=Window;<parent rec>;\;Caption=<caption>;ChildWindow

    To handle these child windows, we parse the typical recognition method for our window and attempt to handle these issues. Once SetContext has successfully set our window, we then remove any "Type=Window" substring if present and add the ";ChildWindow" substring if not present.

    To take advantage of this, this routine must be called with the child window as a component of the parent window like below:

    t, ParentWindow, ChildWindow, Maximize

    If the routine is called like either of the examples below then default processing will occur. This will merely SetContext on the provided Window and use "CurrentWindow" as the parameter to the command.

    t, ParentWindow, ParentWindow, Maximize
    t, ChildWindow , ChildWindow , Maximize (normally won't work)



    Fields: [ ]=Optional with Default Value
      Examples:
      • T, WINDOW, WINDOW, MAXIMIZE
        Sends a Maximize command to the specified Window.

        Sends a Maximize command to the specified Window.

      [How To Read This Reference]

      Autoit WindowFunctions::Minimize
      AUT

      Sends a WMinimize command to the active window.

      Sends a WMinimize command to the active window.

      This Window command has a problem in that it does not want to use the same recognition methods used by the other Window commands (like SetContext). Particularly, it does not accept the Type=Window portion of these recognition methods. In addition, if the window is a child window of a parent then it expects the ";ChildWindow" add-on in the recognition method. The child may also need the parent as part of its full recognition string like:

      ChildWindow=Type=Window;<parent rec>;\;Caption=<caption>;ChildWindow

      To handle these child windows, we parse the typical recognition method for our window and attempt to handle these issues. Once SetContext has successfully set our window, we then remove any "Type=Window" substring if present and add the ";ChildWindow" substring if not present.

      To take advantage of this, this routine must be called with the child window as a component of the parent window like below:

      t, ParentWindow, ChildWindow, Minimize

      If the routine is called like either of the examples below then default processing will occur. This will merely SetContext on the provided Window and use "CurrentWindow" as the parameter to the command.

      t, ParentWindow, ParentWindow, Minimize
      t, ChildWindow , ChildWindow , Minimize (normally won't work)



      Fields: [ ]=Optional with Default Value
        Examples:
        • T, WINDOW, WINDOW, MINIMIZE
          Sends a Minimize command to the specified Window.

          Sends a Minimize command to the specified Window.

        [How To Read This Reference]

        Autoit WindowFunctions::Restore
        AUT

        Sends a RestorePos command to the active window.

        Sends a RestorePos command to the active window.

        This Window command has a problem in that it does not want to use the same recognition methods used by the other Window commands (like SetContext). Particularly, it does not accept the Type=Window portion of these recognition methods. In addition, if the window is a child window of a parent then it expects the ";ChildWindow" add-on in the recognition method. The child may also need the parent as part of its full recognition string like:

        ChildWindow=Type=Window;<parent rec>;\;Caption=<caption>;ChildWindow

        To handle these child windows, we parse the typical recognition method for our window and attempt to handle these issues. Once SetContext has successfully set our window, we then remove any "Type=Window" substring if present and add the ";ChildWindow" substring if not present.

        To take advantage of this, this routine must be called with the child window as a component of the parent window like below:

        t, ParentWindow, ChildWindow, Restore

        If the routine is called like either of the examples below then default processing will occur. This will merely SetContext on the provided Window and use "CurrentWindow" as the parameter to the command.

        t, ParentWindow, ParentWindow, Restore
        t, ChildWindow , ChildWindow , Restore (normally won't work)



        Fields: [ ]=Optional with Default Value
          Examples:
          • T, WINDOW, WINDOW, RESTORE
            Sends a Restore command to the specified Window.

            Sends a Restore command to the specified Window.

          [How To Read This Reference]

          Autoit WindowFunctions::SetPosition
          AUT

          Sends a SetPosition command to the window to set the position, size, and status of the window.

          Sends a SetPosition command to the window to set the position, size, and status of the window. The position, size, and status information is stored in the app map as a subitem in the section for the window. The information should be in the format of:

          "0,0,640,480;Status=NORMAL" OR "Coords=0,0,640,480;Status=NORMAL"

          That example positions the window at 0,0; sizes it to 640 x 480, and sets it's status to NORMAL. Valid values for STATUS are:

          NORMAL, MINIMIZED, and MAXIMIZED

          The Window SetPosition command has a problem in that it does not want to use the same recognition methods used by the other Window commands (like SetContext). Particularly, it does not accept the Type=Window portion of these recognition methods. In addition, if the window is a child window of a parent then it expects the ";ChildWindow" add-on in the recognition method. The child may also need the parent as part of its full recognition string like:

          ChildWindow=Type=Window;<parent rec>;\;Caption=<caption>;ChildWindow

          To handle these child windows, we parse the typical recognition method for our window and attempt to handle these issues. Once SetContext has successfully set our window, we then remove any "Type=Window" substring if present and add the ";ChildWindow" substring if not present.

          To take advantage of this, this routine must be called with the child window as a component of the parent window like below:

          t, ParentWindow, ChildWindow, SetPosition, ChildPositionReference

          If the routine is called like either of the examples below then default processing will occur. This will merely SetContext on the provided Window and use "CurrentWindow" as the parameter to SetPosition.

          t, ParentWindow, ParentWindow, SetPosition, ParentPosition
          t, ChildWindow , ChildWindow , SetPosition, ChildPosition (normally won't work)



          Fields: [ ]=Optional with Default Value
          1. PresetReference
            String specifying a preset reference in the Application for the position, size, and state of the Window.

            String specifying a preset reference in the Application for the position, size, and state of the Window. command.

          Examples:
          • T, WINDOW, WINDOW, SETPOSITION, Preset1
            Preset1 specifies a preset reference in the Application for the position, size, and state of the Window.

            Field 5 : TQ String specifying a preset reference in the Application for the position, size, and state of the Window.

          [How To Read This Reference]