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 however you can obtain the text from the region and access an event that is triggered when the text in the region is changed. This is referred to as 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 OpenSpan Runtime workstations that will use the solution.

To use the function, perform the following steps.

  1. While Interrogating the application, right-click on the target's parent in the Object Explorer and select the Add Control Regions option. The Control Region Editor dialog appears. 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
    : You can also call the Add Control Regions functions from the Windows tab by right-clicking on a the parent object 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 appears below:
     


 

  1. Close the Control Region Editor dialog to save the object. The new Control Region object appears in the 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

  1. Close OpenSpan Studio and open the OpenSpan.ini file.

  2. Find the section marked [GDI]

  3. If you desire to enable GDI hooking (thus enabling Control Regions), change the Enabled flag from 0 (Default) to 1.

  4. For all applications that you wish to activate, include them in the ProcessList function. 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, 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 reopen OpenSpan Studio.

  10. To obtain the text from the ControlRegion, select the ControlRegion and set UseDirectText to True in the Properties window.