Go to Robotic Automation version 22.1 documentation

Adding Control Regions

Control regions are areas of an application that cannot be directly Interrogated. In these cases, you can select the area and create a generic control representing the target. The Control Region has limited properties, methods, and events. You can, however, get text from the region and access an event that is triggered when the text in the region is changed. This is called GDI hooking. To receive event information from the region, you must set GDI parameters in the Openspan.ini file on the design workstation and all Runtime workstations that will use the solution.

To use the function, perform these steps:

  1. While interrogating the application, right-click on the target's parent in Object Explorer and select the Add Control Regions option. The Control Region Editor window is displayed. It can be used to outline a region. Note you can also add control regions from the Windows tab by highlight the target, right-clicking and selecting Add Control Region.   

    Note
    : Another option is to call the Add Control Regions functions from the Windows tab by right-clicking on the parent object in the in the Windows list.

  2. Outline the region. The properties for the region appear in the properties grid. An example for an area on the Calc.exe application is displayed below:


 

  1. Close the Control Region Editor dialog to save the object. The new Control Region object is displayed in Object Explorer and shows as a matched object.

Note: No Match Rules were applied. The Control Region is matched when its parent object is matched.

 

Activating Control Region Functionality

Follow these steps to activate Control Region functionality:

  1. Close Studio and open the Openspan.ini file in a text editor.

  2. Find the section marked [GDI].

  3.  To enable GDI hooking (thus enabling Control Regions), change the Enabled flag from 0 (default) to 1.

  4. Include all applications that you want to activate in the ProcessList function. Here is an example: ProcessList=calc.exe,notepad.exe

  5. If you want GDI hooking activated for all processes, change the AllProcesses flag from 0 to 1.

  6. Set the XTolerance. XTolerance is a horizontal amount to subtract from rectangles to prevent overlapping adjacent fields. For Visual Fox Pro applications, is recommended.

  7. Set the YTolerance. YTolerance is a vertical amount to subtract from rectangles to prevent overlapping adjacent fields. For Visual Fox Pro applications, zero (0) is recommended.

  8. For Control Regions involving bitmaps, set the classname for the Bitmapwindows parameter to that which will have their bitmaps captured from the internal bitmaps maintained by an application. For Visual Fox Pro applications, this should be set to amw6c000000.

  9. Save the Openspan.ini file and restart Studio.

  10. To get the text from the Control Region, select the Control Region and set UseDirectText to True in the Properties window.

 


Privacy | Trademarks | Terms of Use | Feedback

Updated: 01 July 2024

© 2016 - 2024 Pegasystems Inc.  Cambridge, MA All rights reserved.

 

OpenSpan data classification label