ScreenToWindow Method

Applies to TestComplete 15.65, last modified on July 17, 2024


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


TestObj.ScreenToWindow(X, Y)

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.


The method has the following parameters:


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


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

Result Value

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


  • 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.


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

See Also

Point Object
WindowToScreen Method

Highlight search results