OnOverlappingWindow Event

Applies to TestComplete 15.64, last modified on June 12, 2024

Occurs when an overlapping window appears.


OnOverlappingWindow(SenderWindowOverlappingWindowLogParams) Parameters
Sender [in] Required Variant
Window [in] Required An OnscreenObject object
OverlappingWindow [in] Required An OnscreenObject object
LogParams [in] Required A LogParams object


The event occurs when your script tries to simulate a mouse click over a window or control, but that window or control is overlapped by another window or control so that the click cannot be executed. If the Ignore overlapping window option in the Playback settings of your project dialog is enabled, TestComplete ignores the overlapping window and continues the script run. If this option is off, the script execution is halted. Write an OnOverlappingWindow event handler to perform desired actions if an overlapping window appears. For instance, you can post an image of the overlapping window to the log or stop the script if an “unknown” overlapping window appears.

Important Notes:

  • If the OnOverlappingWindow event handler simulates a mouse click, TestComplete will check for an overlapping window and if the click is performed over the overlapped window, the event handling routine will be called recursively. To avoid recursion, do not simulate mouse clicks or keypresses over the overlapped window within this event handler.

  • The OnOverlappingWindow event does not work for windowless objects. That is, if the target window or control is overlapped by a windowless object (for example, a modal object implemented in a web application with a div element) the event does not occur. For more information, see Handling Unexpected Windows.


The event has the following parameters:


The Event control that processes the event.


Specifies the OnscreenObject object (window or control) to which a mouse click or a keypress is addressed.


Specifies the OnscreenObject object that overlaps the Window.


Properties of the LogParams object hold text, priority, color and other attributes of the error message posted to the log. The Locked property of this object is meaningful only if the Ignore overlapping window project option is disabled. It lets you specify whether TestComplete should cancel further processing of the overlapping window. Setting Locked to True will tell TestComplete to ignore the overlapping window. If the option is on, TestComplete will always ignore this window regardless of the Locked value.


For information on how to create an event handler for this and other TestComplete events, see Handling Events.

See Also

Handling Unexpected Windows
OnUnexpectedWindow Event
Handling Events
Event Control
Testing Modal Windows

Highlight search results