Window - List windows

Declaration

<AMWINDOW ACTIVITY="information" ALLOWHIDDEN="YES/NO" RESULTDATASET="text" />

Related Topics  

Description

Retrieves a list of all open windows and populates a dataset with the results. Hidden windows can be retrieved as well.

Practical usage

Commonly used along with the Loop dataset activity as a method to manage the windows that are open on the desktop.

Parameters

General

 
PropertyTypeRequiredDefaultMarkupDescription
Create and populate datasetTextYes(Empty)RESULTDATASET="windowData"The name of the dataset to create and populate with the list of open windows. More details about the dataset that this activity creates can be found below under Datasets.
Include hidden windowsYes/NoNoYesALLOWHIDDEN="YES"If selected, hidden windows will be included in the list. Disabled by default.

Description

Error Causes

On Error

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

NameTypeReturn Value
theDataset.TitleTextReturns the window title of the current window on the list.
theDataset.ClassTextReturns the class of the current window on the list.  
theDataset.HandleNumberReturns the handle of the current window on the list.
theDataset.ProcessNameTextReturns the process name of the current window on the list.
theDataset.ProcessIDNumberReturns the process ID of the current window on the list.

Example

NOTE:
  • 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

This sample task saves all open windows onto a dataset. A Loop dataset activity is then used to display information about each open window.  

Copy
<AMWINDOW ACTIVITY="information" ALLOWHIDDEN="YES" RESULTDATASET="theDataset" />
<AMLOOP ACTIVITY="dataset" DATASET="theDataset"><AMSHOWDIALOG WINDOWTITLE="Current Window">Window title - %theDataset.Title%
Window class - %theDataset.Class%
Window handle - %theDataset.Handle%
Window process name - %theDataset.ProcessName%
Window process ID - %theDataset.ProcessId%</AMSHOWDIALOG></AMLOOP>
<AMSHOWDIALOG WINDOWTITLE="Current Window">Window title - %theDataset.Title%Window class - %theDataset.Class%Window handle - %theDataset.Handle%Window process name - %theDataset.ProcessName%Window process ID - %theDataset.ProcessId%</AMSHOWDIALOG>
<AMLOOP ACTIVITY="end" />