ScreenToWindow Method

Applies to TestComplete 14.71, last modified on April 22, 2021

Description

Use this method to get object-related coordinates from coordinates that are relative to the screen.

Declaration

TestObj.ScreenToWindow(XY)

TestObj A variable, parameter or expression that specifies a reference to one of the objects listed in the Applies To section
X [in]    Required    Integer    
Y [in]    Required    Integer    
Result A Point object

Applies To

All onscreen objects.

View Mode

To view this method in the Object Browser panel and in other panels and dialogs, activate the Advanced view mode.

Parameters

The method has the following parameters:

X

Specifies the horizontal coordinate of the point relative to the screen.

Y

Specifies the vertical coordinate of the point relative to the screen.

Result Value

The Point object that holds the resultant object-related coordinates.

Remarks

  • Desktop testing: If TestObj refers to an object of a non-DPI-aware application running with a DPI setting other than 100%, the resulting Point object will hold coordinates relative to the application (as if the application is running with the 100% DPI setting).

  • Web testing: If the Use CSS pixels for scaled pages option is enabled (by default), the resulting Point object will hold coordinates that take into account the browser zoom and the current DPI setting.

Example

To view an example that demonstrates how to use the ScreenToWindow method, see Displaying Context Menus.

See Also

Point Object
WindowToScreen Method

Highlight search results