Resize Window Action Icon

Resize Window

Declaration

<AMWINDOWRESIZE WIDTH="number" HEIGHT="number" WINDOWTITLE="text" WINDOWHANDLE="text" ALLOWHIDDEN="yes/no" WINDOWHANDLEVARIABLE="text (variable name)" WINDOWCLASSVARIABLE="text (variable name)" WINDOWTITLEVARIABLE="text (variable name)" RESULTDATASET="text (dataset name)" />

See Also

Focus Window | Maximize Window | Minimize Window | Restore Window | Hide Window | Unhide Window | Move Window | Wait for Window | End Process

Description

Re-sizes the specified window or windows to the specified dimensions.

Practical Usage

Commonly used to set one or more windows to a certain size, often to ensure automated mouse clicks line up properly.

Parameters

General Properties

To select a currently open window, you may perform one of the following:

  1. Drag the AutoMate icon to the desired window. This populates the Window title must be, Window class must be and Window handle must be parameters with the appropriate values.

  2. Click the drop-down arrow associated with the Window title must be and/or Window class must be parameters and select the desired title/class from the list that appears.

Property

Type

Req'd

Default

Markup

Description

Window title must be

Text

Yes

*

  1. WINDOWTITLE="Untitled - Notepad"

  2. WINDOWTITLE="*Internet Explorer*"

If enabled, specifies the title of the window to re-size This value is case-insensitive. A Window title is required because without this parameter the action would have to search every control of every single Window on the system which would take an unacceptable amount of time. This parameter supports wildcards (* and ?), for example "*Internet Explorer* would include all Windows containing that text.

NOTE: If this parameter is left blank, the action assumes it is searching for a Window title that is blank - to ignore the Window title, use the * symbol.

Window class must be

Text

No

*

WINDOWCLASS="Outlook Express Browser Class"

If enabled, specifies the class of the Window to re-size. This value is case-insensitive. 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 window class. All window classes are process specific. This parameter supports wildcards (* and ?), for example "*Internet Explorer* would include all window classes containing that text.

NOTE: If this parameter is left blank, the action assumes it is searching for a Window class that is blank - to ignore the Window class, use the * symbol.

Window handle must be

Number

No

0

WINDOWHANDLE="555735"

If enabled, specifies the handle of the Window to re-size. If set to 0 or omitted, this parameter is ignored. The window handle is code that uniquely identifies a window.

New Width

Number

Yes

(Empty)

WIDTH="780"

The new width in pixels that the window will be re-sized to.

New Height

Number

Yes

(Empty)

HEIGHT="400"

The new height in pixels that the window will be re-sized to.

Contents Properties

The Contents tab contains standard window dissection parameters used to describe controls or text inside a window. These parameters are documented under Window Dissection Parameters and can be used to define additional window characteristics used to determine a matching window.

To specify additional window characteristics, enable the option Window must contain the object(s), click the Add button and drag the AutoMate icon to the desired window object or control. The "Object Description" segment becomes populated with the characteristics of the selected object. Click the Edit button to access/edit the following properties:

Property

Type

Req'd

Default

Markup

Description

Object type must be

Yes/No

Yes

Yes

CHECKOBJECTTYPE="YES"

If set to YES, specifies that the value populated in the Object type parameter will be examined when determining a matching object. If set to NO, the Object type parameter is ignored.

Object type (Text-box)

Text

Yes

(Empty)

OBJECTTYPE="PushButton"

The type of object or control that should be examined. This parameter is ignored if the Object type must be parameter is set to NO.

Object class must be

Yes/No

No

No

CHECKOBJECTCLASS="YES"

If set to YES, specifies that the value populated in the Object class parameter will be examined when determining a matching object. If set to NO the Object class parameter is ignored.

Object class (text-box)

Text

No

(Empty)

OBJECTCLASS="SysTreeView32"

The object class that should be examined. This parameter is ignored if the Object class must be parameter is set to NO.

Object name must be

Yes/No

No

No

CHECKOBJECTNAME="YES"

If set to YES, specifies that the value populated in the Object name parameter will be examined when determining a matching object. If set to NO the Object name parameter is ignored.

Object name (text-box)

Text

No

(Empty)

OBJECTNAME="Cancel"

The object name that should be examined. This parameter is ignored if the Object name must be parameter is set to NO.

Object value must be

Yes/No

No

No

CHECKOBJECTNAME="YES"

If set to YES, specifies that the value populated in the Object value parameter will be examined when determining a matching object. If set to NO the Object value parameter is ignored.

Object value (text-box)

Text

No

(Empty)

OBJECTVALUE="1"

The object value that should be examined. This parameter is ignored if the Object value must be parameter is set to NO.

Object position must be

Yes/No

No

No

CHECKOBJECTPOSITION="YES"

If set to YES, specifies that the X and Y coordinates will be examined when determining a matching object. If set to NO, the position of the object is ignored.

NOTE: The X and Y coordinates are relative to the Window specified in the Window title must be parameter (not the screen).

Position X

Text

No

(Empty)

OBJECTXPOS="80"

The X coordinate position of the object relative to the window specified in the Window title must be parameter. To specify variable coordinates, use wildcard characters (i.e. * or ?). This parameter is ignored if the Object position must be parameter is set to NO.

Position Y

Text

No

(Empty)

OBJECTYPOS="90"

Specifies the Y coordinate position of the control relative to the Window specified in the Window title must be parameter. To specify variable coordinates, use wildcard characters (i.e. * or ?). This parameter is ignored if the Object position must be parameter is set to NO.

Advanced Properties

Property

Type

Req'd

Default

Markup

Description

Include hidden windows

Yes/No

No

No

ALLOWHIDDEN="YES"

If set to YES, specifies that hidden (non-visible) windows should be included in the window search. By default, hidden windows are not searched.

Populate variable with window title

Text

No

(Empty)

WINDOWTITLEVARIABLE=VarName"

If enabled, specifies the name of an already existing variable that should be populated with the title of the window that was re-sized.

Populate variable with window class

Text

No

(Empty)

WINDOWCLASSVARIABLE="VarName"

If enabled, specifies the name of an already existing variable that should be populated with the class of the window that was re-sized.

Populate variable with window handle

Text

No

(Empty)

WINDOWHANDLEVARIABLE="VarName"

If enabled, specifies the name of an already existing variable that should be populated with the handle of the window that was re-sized.

Create and populate dataset

Text

No

(Empty)

RESULTDATASET="DatasetName"

The name of a dataset to be created and populated with window data from the window that was re-sized. More on the fields that this dataset creates can be found under Notes below. More about this dataset can be found below under Notes.

Description Properties

The Description tab allows you to customize the text description of any step as it appears in the Task Builder's Steps Pane.

More on setting custom step description

Error Causes Properties

The Error Causes tab allows you to select/omit specific errors that should cause a particular step to fail.

More on Error Causes properties

On Error Properties

The On Error tab allows you to determine what the task should do if a particular step encounters an error.

More about On Error properties

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 table below describes these fields (assuming the dataset name assigned was theDataset).

Name

Type

Return Value

theDataset.Title

Text

Returns the window title of the window that was re-sized.

theDataset.Class

Text

Returns the class of the window that was re-sized.  

theDataset.Handle

Number

Returns the handle of the window that was re-sized.

Variables and Expressions

All text fields allow the use of expressions, which can be entered by surrounding the expression in percentage signs (example: %MYVARIABLE%, %Left('Text',2)%). To help construct these expressions, you can open Expression Builder from these fields by pressing F2.

More on variables
More on expressions

More on the expression builder

Window Dissection™ Technology

This action contains a subset of Network Automation's unique "Window Dissection Technology".

More on Window Dissection

Example

NOTE: The code below can be copied and pasted directly into the Steps pane of the Task Builder.

 

This task opens a Notepad window and re-sizes it to the new width of 800 pixels and new height of 600 pixels.

 

<AMRUN FILE="Notepad" />

<AMSENDKEY>The next step will resize the Notepad window. The new width will be 800px and the new height will be 600px.</AMSENDKEY>

<AMWINDOWRESIZE WIDTH="800" HEIGHT="600" WINDOWTITLE="*notepad*" />

 

↑ [Return to Top]