WindowClose Method

Action2 Example

 

Encapsulates the AutoMate™ action in the “Window” group, “Close.” Finds the window with the title text indicated and closes the window.

 

Declaration

function WindowClose(varWindowTitle As Variant,

intExactMatch As Integer) As Integer

 

Parameters

varWindowTitle

 The text of the window title to be hidden.

 

intExactMatch

 Whether or not the title bar text should match varWindowTitle exactly or partially. Use “0” for a partial match or “1” for an exact match.

 

Description

The WindowClose method will attempt to locate a window with the title specified in the varWindowTitle parameter. If a window exists, AutoMate™ will attempt to close the window. The window will not appear in the taskbar if hidden. If a window cannot be found, the method returns “1”, indicating a failed step.

 

If multiple windows are found matching varWindowTitle, AutoMate™ will attempt to close the first window it eternally enumerates.

 

NOTE: Most applications will terminate once their main window is closed. Therefore, try using the WindowClose command to terminate applications through the AutoMate™ scripting language.