Window -
Minimize
Declaration
<AMWINDOW ACTIVITY="minimize" WINDOWTITLE="text" WINDOWCLASS="text" WINDOWHANDLE="number" CONTAINSOBJECT="YES/NO" OBJECTPROPERTYSETS="Toolkit=text,Type=text,Class=text,FrameworkId=text,Name=text,AutomationId=text,Value=text,Role=text,Description=text,X=number,Y=number,Width=number,Height=number,IndexInParent=text,ParentPath=text,Occurrence=number" WINDOWTITLEVARIABLE="text" WINDOWCLASSVARIABLE="text" WINDOWHANDLEVARIABLE="text" RESULTDATASET="text" />
Overview
Minimizes a window, which causes it to disappear from view and appear only in the task bar. You can use the window title, class, handle, and other properties to specify the window.
Practical usage
Used to minimize a window so it does not interfere with the execution of subsequent activities such as keystrokes and mouse clicks.
Parameters
General
This activity comprises Automate Desktop Window Dissection technology to facilitate the discovery of existing windows and their controls. To select the target window:
- Ensure the window is open and in the foreground (in front of all other open windows).
- Drag and release the magnifier icon over the window. If the window is supported by this activity, a green border appears around it.
- Upon releasing the icon, identified window properties are populated into the editor. These properties can be enabled/disabled or further modified.
| Property | Type | Required | Default | Markup | Description |
|---|---|---|---|---|---|
| By window title | Text | Yes | (Empty) | WINDOWTITLE="*Explorer" | If enabled, indicates the title of the window to minimize. If disabled, the window title is ignored. This parameter supports wildcard characters (* or ?). For example, entering *Notepad* includes any window with the word Notepad in its title. |
| By window class | Text | No | (Empty) | WINDOWCLASS="Outlook Browser" | If enabled, indicates the class of the window to minimize. If disabled, the window class is ignored. A window class is a set of attributes that the system uses as a template to create a window. Every window is a member of a class and all window classes are process specific. This parameter supports wildcard characters (* or ?). For example, entering *Microsoft Edge* include any windows containing Microsoft Edge as its class. |
| By window handle | Number | No | (Empty) | WINDOWHANDLE="555735" | If enabled, indicates the handle of the window to minimize. If disabled, the window handle is ignored. A window handle is numeric code that uniquely identifies a window. This parameter supports wildcard characters (* or ?). |
| Accessibility engine | Text (options) | No | Auto |
|
The
accessibility engine that this activity uses to programmatically
collect accurate information about a user interface in order to
interact with it. The available options are:
|
Window contents
If multiple windows with the same title exists, it might be necessary to use Automate Desktop Object Editor to specify additional criteria, such as unique objects, controls or properties, to distinguish one window from another. To identify additional elements, enable Window must contain the following objects and click Add to open the Object Editor dialog. Do one of the following:
- Drag and release the magnifier icon over the desired object or control. The Object properties grid is populated with a list of name/value pairs unique to that object. Individual values can be enabled/disabled according to preference.
- Click Browse to traverse the list of available objects/controls for the selected window. Select the desired object from the Window contents column and click OK. The Object properties grid is populated with a list of defined properties unique to that object. Individual values can be enabled or disabled according to preference.
Available object properties are described below:
| Property | Type | Required | Default | Markup | Description |
|---|---|---|---|---|---|
| Toolkit | Text | No | (Empty) |
|
If enabled, specifies that the toolkit (a set of basic building units for graphical user interfaces) is examined when determining a matching object. If disabled, the toolkit is ignored. The toolkit that appears is based on the Accessibility engine used:
|
| Type | Text | No | (Empty) | TYPE=PushButton | If enabled, specifies that the object type (button, check box, trackbar) is examined when determining a matching object. If disabled, the type is ignored. |
| Class | Text | No | (Empty) | CLASS=SysTreeView32 | If enabled, specifies that the object class (XTPToolBar, SysTreeView, MDIClient) is examined when determining a matching object. If disabled, the class is ignored. |
| FrameworkId | Text | No | (Empty) | FRAMEWORKID=WPF | If enabled, specifies that the object framework ID (the framework technology used to create the object) is examined when determining a matching object. If disabled, the framework ID is ignored. |
| Name | Text | No | (Empty) | NAME=Cancel | If enabled, specifies that the object name (a unique identifier for an object) is examined when determining a matching object. If disabled, the name is ignored. |
| AutomationId | Text | No | (Empty) | AUTOMATIONID=System | If enabled, specifies that the object automation ID (a unique identifier for an object) is examined when determining a matching object. If disabled, the automation ID is ignored. |
| Value | Text | No | (Empty) | VALUE=1 | If enabled, specifies that the object value (which usually coincides with the Name property) is examined when determining a matching object. If disabled, the value is ignored. |
| Role | Text | No | (Empty) | ROLE=desktop pane | If enabled, specifies that the object role type (the control type provided by the Java Accessibility bridge) is examined when determining a matching object. If disabled, the role type is ignored. |
| Description | Text | No | (Empty) | DESCRIPTION=JScrollPane | If enabled, specifies that the object description (the description given for an object) is examined when determining a matching object. If disabled, the description is ignored. |
| X | Number | No | (Empty) | X=80 | If
enabled, specifies that the object X coordinate (a given
number of pixels along the horizontal axis of a window starting
from the extreme left side) is examined when determining
a matching object. If disabled, the X coordinate is
ignored. NOTE: The X and Y coordinates are relative to the specified window as
opposed to the screen. |
| Y | Number | No | (Empty) | Y=90 | If
enabled, specifies that the object Y coordinate (a given
number of pixels along the vertical axis of a window starting
from the top-most portion) is examined when determining a
matching object. If disabled, the Y coordinates is ignored.
NOTE: The X and Y coordinates are relative to the specified window as
opposed to the screen. |
| Width | Number | No | (Empty) | WIDTH=711 | If enabled, specifies that the object pixel width is examined when determining a matching object. If disabled, the pixel width is ignored. |
| Height | Number | No | (Empty) | HEIGHT=42 | If enabled, specifies that the object pixel height is examined when determining a matching object. If disabled, the pixel height is ignored. |
| IndexInParent | Text | No | (Empty) | INDEXINPARENT=1 | If enabled, specifies that the object index in parent number (the numeric identifier of a child object located within a parent object) is examined when determining a matching object. If disabled, the index in parent number is ignored. |
| ParentPath | Text | No | (Empty) | PARENTPATH=50032|50033 | If enabled, specifies that the object parent path (the sequence of control type identifiers that lead to the object) is examined when determining a matching object. If disabled, the parent path is ignored. |
| Occurrence | Number | No | (Empty) | OCCURRENCE=1 | If enabled, specifies that the object occurrence (the numeric identifier of an object, useful when multiple matching objects are found) is examined when determining a matching object. If disabled, the occurrence is ignored. |
Advanced
| Property | Type | Required | Default | Markup | Description |
|---|---|---|---|---|---|
| Include hidden windows | Yes/No | No | Yes | ALLOWHIDDEN="YES" | If selected, hidden (non-visible) windows are included in the window search. This parameter is disabled by default. |
| Populate variable with window title | Text | No | (Empty) | WINDOWTITLEVARIABLE="theTitle" | If enabled, specifies the name of an existing variable that should be populated with the title of the minimized window. |
| Populate variable with window class | Text | No | (Empty) | WINDOWCLASSVARIABLE="theClass" | If enabled, specifies the name of an existing variable to populate with the class of the minimized window. |
| Populate variable with window handle | Text | No | (Empty) | WINDOWHANDLEVARIABLE="theHandle" | If enabled, specifies the name of an existing variable to populate with the handle of the minimized window. |
| Create and populate dataset | Text | No | (Empty) | RESULTDATASET="DatasetName" | If enabled, specifies the name of a dataset to create and populate with information about the minimized window. More on the fields that this dataset creates can be found under Datasets below. |
Additional notes
Datasets
A dataset is a multiple column, multiple row container object. This activity creates and populates a dataset containing a specific set of fields in addition to the standard dataset fields. The following table describes these fields (assuming the dataset name assigned is theDataset):
| Name | Type | Return Value |
|---|---|---|
| theDataset.Title | Text | The window title of the minimized window. |
| theDataset.Class | Text | The class of the minimized window. |
| theDataset.Handle | Number | The handle of the minimized window. |
Example
- Copy and paste the sample AML code below directly into the Task Builder Steps Panel.
- To successfully run the sample code, update parameters containing user credentials, files, file paths, or other information specific to the task to match your environment.
Description
The following sample task performs various window related activities on a Notepad window. A message appears a step ahead of each window related activity before it is executed. Each window activity displays information about each operation before it is opens before each operation Details about each operation is displayed.
<AMRUN FILE="Notepad" />
<AMSHOWDIALOG MESSAGE="The next step will minimize the Notepad window." />
<AMWINDOW ACTIVITY="minimize" WINDOWTITLE="*notepad*" />
<AMSHOWDIALOG MESSAGE="The next step will maximize the Notepad window." />
<AMWINDOW ACTIVITY="maximize" WINDOWTITLE="*notepad*" />
<AMSHOWDIALOG MESSAGE="The next step will restore the Notepad window to its original size." />
<AMWINDOW ACTIVITY="restore" WINDOWTITLE="*notepad*" />
<AMSHOWDIALOG MESSAGE="The next step will move the Notepad window to the upper left corner of the screen." />
<AMWINDOW ACTIVITY="move" WINDOWTITLE="*notepad*" />
<AMSHOWDIALOG MESSAGE="The last step will close the Notepad window." />
<AMWINDOW ACTIVITY="close" WINDOWTITLE="*notepad*" />