Find Window

The Find Window component enables users find and set focus on application windows running in background or minimized.

Screenshot

Supported Functions

To use the windows settings:

  1. In the Toolbox, expand General.
  2. Drag the Find Window component and drop it on the Design surface.
  3. Double-click the component title-bar.
    The Window Settings dialog box is displayed.

    Screenshot

  4. From the window setting window, drag the Bullseye pointer ( Screenshot)and drop it on the window or application needed to be identified.

  5. Studio will display the potential match rules window, where a user can select the parameters that will be used to uniquely identify the required window/application.Users can select multiple match rules, by holding the Control button on the keyboard and clicking on each match rule.
  6. Properties of each match rules can be changed by selecting the appropriate comparison type and comparison value properties.

Ports

The Find Window component exposes Control In, Control Out, and a Data Out port by default.

Port Description
Control In Must be connected to the Control Out port of one or more components.
Control Out Must be connected to the Control In port of any other component. The FindWindow component exposes the following two types of Control Out ports:
Success: Upon successful execution of the Find Window component, execution flow is passed to the component connected to this port, and can be connected to the Control In port of any other component.
Fail: If the Find Window component fails to execution because of any reason, execution flow is passed to the component connected to this port, and can be connected to the Control In port of any other component.
Data Out Must be connected to the Data In port of another component that accepts Window Handle as Data Input (IntPtr).

Properties

To edit the properties of the Find Window component, in the Properties window, change the required property. Users can edit the following properties-

Property Description
Search Search for the respective property.
Delay After Execution Specifies the wait time (in seconds) after the action is executed.
Delay Before Execution Specifies the wait time (in seconds) before the action is executed.
Name Specifies the name to identify the component. Users must set the name to match the application field they are interacting with.
Enable Timeout Enables custom timeout.
Timeout Specifies the custom time for the timeout.
Max Wait Time (Seconds) Specifies the maximum wait time (in seconds) before the action is executed.
Wait for Window Specifies the wait time (in seconds) for the window to open before it is identified.

Example

Let us consider an example of a retrieving the calendar application.

Screenshot

To use the Find Window component:

  1. In the Toolbox, expand General.
  2. Drag the Find Window component and drop it on the Design surface.
  3. Double-click the component title-bar.
    The Window Settings dialog box is displayed.

    Screenshot

  4. In the Window Settings dialog box, in the upper-right, drag and drop the pointer on the window user wants to be identified.

  5. The Potential Match Rules window with a potential list of identifiers is displayed.

    Screenshot

  6. Select an identifier from the list. Users can also use the Control Key + Mouse Click to select multiple match rules.

  7. Click OK.
    The selected identifier is displayed in the Window Settings dialog box, in the left pane.

    Note

    Users can add multiple identifiers to the list.
    Right-click the displayed identifier and select delete to remove it from the list.

  8. Select the particular identifier to view and edit its properties in the right pane.

    Property Description
    Search Search for the respective property.
    Comparer Comparison Type: Performs a comparison of an objects of the same type and returns matching value.
    Equals: When Object name is equal to Comparison Value.
    Contains: When an Object name contains Comparison Value.
    Starts With: When an Object name starts with Comparison Value.
    Ends With: When an Object name ends with Comparison Value.
    Regex: Use Regex patterns to match.
    Comparison Value: Value that will be used for comparison.
    Enabled Default: Enabled
    Can be used to temporarily disable the comparison rule.
  9. Click OK.

  10. Add a MessageBox Show component to display a success message or a failure message which will promt when the required window is found or missing.

  11. To add the MessageBox component::

    • In the Toolbox, expand General.
    • Expand MessageBox components , drag two Show components and drop it on the Design surface.
    • In one Show component, enter a success message to be displayed when the window is found.
    • In one Show component, enter a failure message to be displayed when the window is missing.
  12. Connect:

    • The control ports of all components.
    • The Success Control Out port of the Find Window component to the Control In port of the MessageBox component with the success message.
    • The Fail Control Out port of the Find Window component to the Control In port of the MessageBox component with the failure message.
  13. In the toolbar, click Run.
    The output with the success messagebox and the window is displayed if the window is found.

    Screenshot

  14. The output with the failure message is displayed if the window is missing.

    Screenshot