Skip to main content

General Windows methods

Suggest edit Updated on November 10, 2021
Pega Robot Studio v21 Preview

Use General Windows methods to define actions in your automation.

MethodDescriptionParametersReturn
ActivateActivates the control and gives it focus within the Studio project. NoneVoid
DestroyTooltipDeletes a tool tip from a control to which it has been assigned. NoneVoid
Detach

Unmatches this control from the target that it is matched to. This method is used when an automation might need to force a control to un-match before calling the Rematch or RematchChildren method to re-match controls.

Note: Rematch or RematchChildren should only be used when there is an issue that prevents matching from working correctly.

NoneVoid
FocusCauses the element to receive the focus and executes the code specified by the GotFocus event. NoneVoid
GetClonesReturns a collection of cloned objects. Use the GetClones method in combination with a ListLoop component to iterate over the list of cloned objects to extract individual list items. NoneNone
GetEventInitiates downstream logic pending the occurrence of a particular event. Click the Name parameter in the GetEvent design block to view a list of events applicable for the component. Select the event, and then create a proxy from the GetEvent result. For more information, see Get Event for Windows Controls and Forms. EventName name Event
GetHandleUse to return the handle of a window. This method returns an IntPtr window handle of this target. This method is available for all Windows controls. NoneInt32
GetTextUse to get a large text buffer from a control. Int32 bufferSize String
Hide

Removes the control from view. Removes the cell from view. See UnMatchOnHidden to understand how hiding an application changes control matching.

Note: Avoid using this method when automating applications because some applications and controls must be on an active desktop and visible.

NoneVoid
HideTooltipCauses the tool tip for the control to be hidden from view. NoneVoid
IsKeyAssigned Verifies that Key is assigned. String key Boolean
PerformClick

Simulates a click by causing the Click event to fire. The event is fired asynchronously.

The system executes asynchronous clicks on a separate thread. Control returns to the calling thread immediately.

The PerformClick method relies on native injection to work and this is not available when you use the Chrome Universal Web Adapter to interrogate the Chrome browser. You can, however, use this methods to interrogate controls on the webpage being displayed, just not Chrome browser controls, such as Refresh, Minimize, and Maximize.

NoneVoid
PerformClick

Simulates a click by causing the Click event to fire. Click is performed at the x and y location specified by the parameters. The event is fired asynchronously.

The system executes asynchronous clicks on a separate thread. Control returns to the calling thread immediately.

The PerformClick method relies on native injection to work and this is not available when you use the Chrome Universal Web Adapter to interrogate the Chrome browser. You can, however, use this methods to interrogate controls on the webpage being displayed, just not Chrome browser controls, such as Refresh, Minimize, and Maximize.

Int32 x, Int32 y Void
PerformDoubleClick

Simulates a double-click by causing the DoubleClick event to fire. Event is fired asynchronously.

The system executes asynchronous clicks on a separate thread. Control returns to the calling thread immediately.

NoneVoid
PerformDoubleClick

Simulates a double-click by causing the DoubleClick event to fire. Click is performed at the x and y location specified by the parameters. The event is fired asynchronously.

The system executes asynchronous clicks on a separate thread. Control returns to the calling thread immediately.

Int32 x, Int32 y Void
PerformRightClick

Simulates a right-click by causing the RightClick event to fire. The event is fired asynchronously.

The system executes asynchronous clicks on a separate thread. Control returns to the calling thread immediately.

NoneVoid
PerformRightClick

Simulates a right-click by causing the RightClick event to fire. RightClick is performed at the x and y location specified by the parameters. The event is fired asynchronously.

The system executes asynchronous clicks on a separate thread. Control returns to the calling thread immediately.

Int32 x, Int32 y Void
PerformSynchronousClick

Simulates a click by causing the Click event to fire. The event is fired synchronously.

Simulates a click by causing the Click event to fire. The event is fired synchronously.

NoneVoid
PerformSynchronousClick

Simulates a click by causing the Click event to fire. The event is fired synchronously.

Note: This method is not implemented for Java version 1.4 - 1.6 controls.

Synchronous clicks are executed on the calling thread. The method waits for all click messages to be processed.

Int32 timeout Void
PerformSynchronousClick

Simulates a click by causing the Click event to fire. Click is performed at the x and y location specified by the parameters. The event is fired synchronously.

Synchronous clicks are executed on the calling thread. The method waits for all click messages to be processed.

Int32 x, Int32 y Void
PerformSynchronousClick

Simulates a click by causing the Click event to fire. Click is performed at the x and y location specified by the parameters. The event is fired synchronously.

Note: This method is not implemented for Java version 1.4 - 1.6 controls.

Synchronous clicks are executed on the calling thread. The method waits for all click messages to be processed.

Int32 timeout, Int32 x, Int32 y Void
PerformSynchronousDoubleClick

Simulates a double-click by causing the DoubleClick event to fire. The event is fired synchronously.

Synchronous clicks are executed on the calling thread. The method waits for all click messages to be processed.

NoneVoid
PerformSynchronousDoubleClick

Simulates a double-click by causing the DoubleClick event to fire. The event is fired synchronously.

Note: This method is not implemented for Java version 1.4 - 1.6 controls.

Synchronous clicks are executed on the calling thread. The method waits for all click messages to be processed.

Int32 timeout Void
PerformSynchronousDoubleClick

Simulates a double-click by causing the DoubleClick event to fire. Click is performed at the x and y location specified by the parameters. The event is fired synchronously.

Synchronous clicks are executed on the calling thread. The method waits for all click messages to be processed.

Int32 x, Int32 y Void
PerformSynchronousDoubleClick

Simulates a double-click by causing the DoubleClick event to fire. Click is performed at the x and y location specified by the parameters. The event is fired synchronously.

Note: This method is not implemented for Java version 1.4 - 1.6 controls.

Synchronous clicks are executed on the calling thread. The method waits for all click messages to be processed.

Int32 timeout, Int32 x, Int32 y Void
PerformSynchronousRightClick

Simulates a right-click by causing the RightClick event to fire. The event is fired synchronously.

Synchronous clicks are executed on the calling thread. The method waits for all click messages to be processed.

NoneVoid
PerformSynchronousRightClick

Simulates a right-click by causing the RightClick event to fire. The event is fired synchronously.

Note: This method is not implemented for Java version 1.4 - 1.6 controls.

Synchronous clicks are executed on the calling thread. The method waits for all click messages to be processed.

Int32 timeout Void
PerformSynchronousRightClick

Simulates a right-click by causing the RightClick event to fire. Click is performed at the x and y location specified by the parameters. The event is fired synchronously.

Synchronous clicks are executed on the calling thread. The method waits for all click messages to be processed.

Int32 x, Int32 y Void
PerformSynchronousRightClick

Simulates a right-click by causing the RightClick event to fire. Click is performed at the x and y location specified by the parameters. The event is fired synchronously.

Note: This method is not implemented for Java version 1.4 - 1.6 controls.

Synchronous clicks are executed on the calling thread. The method waits for all click messages to be processed.

Int32 timeout, Int32 x, Int32 y Void
RematchRefreshes matching on the control and all child controls. If the control is currently matched, Studio detaches (unmatches) the control and children before attempting to rematch. If the control is currently unmatched, you can only call Rematch if the parent is matched. NoneVoid
RematchChildrenRefreshes matching on all objects under the control. Set the detach property to True to unmatch all targets before attempting to rematch. Boolean detach Void
ResetState Resets all component properties to their initial values. NoneVoid
SendKeysSends a key command to a control. For more information, see SendKeys method. String keys Boolean focusVoid
SetNextKeySets the key for the control when the UseKeys property is True, indicating that clones of this control can be created when multiple matching targets are found. For more information, see Cloned Controls. String key Void
ShowMakes the control visible after the Hide method has been called. See UnMatchOnHidden to understand how hiding an application changes control matching. NoneVoid
ShowContextMenu Displays a context menu associated with the control. NoneVoid
ShowContextMenuDisplays a context menu associated with the control. The menu is displayed at the x and y location, as specified by the parameters. Int32 x, Int32 y Void
ShowTooltipCreates a tool tip for the control. There are five overloads of this method (1, 2, 3, 5, 7 parameters). For more information, see Using the ShowToolTip Method. String text, String title, ToolTipAnchorPosition anchorPosition, Color textColor, Color backgroundColor, Int32 maxWidth, ToolTipIcon iconVoid
WaitForCreate Waits for the control to be created (matched). Returns True if the control is created before the WaitTimeout period elapses. Otherwise, it returns False. For more information, see Wait For Create. NoneBoolean
WaitForCreateWaits for the control to be created (matched). Returns True if the control is created before the specified number of milliseconds has elapsed. Otherwise, it returns False. For more information, see Wait For Create. Int32 milliseconds Boolean

Did you find this content helpful? YesNo

Have a question? Get answers now.

Visit the Support Center to ask questions, engage in discussions, share ideas, and help others.

We'd prefer it if you saw us at our best.

Pega.com is not optimized for Internet Explorer. For the optimal experience, please use:

Close Deprecation Notice
Contact us