GetActive Function (Desktop MainWin)

Class

DesktopWin and MainWin.

Action

Returns the active window on the desktop or in the application.

Availability

This functionality is supported only if you are using the Classic Agent.

Syntax

wActive = window.GetActive()
Variable Description
wActive The active window. WINDOW.

Notes

GetActive returns the current active window. If no window is active, Silk Test Classic raises the exception E_NO_ACTIVE_WINDOW. GetActive is not supported on the X Window System.

Windows

For a MainWin, use GetActive to return the currently active MDI child window of the application. If the application does not contain MDI child windows, GetActive raises an exception. For a DesktopWin, GetActive returns the "Active" window (under Win16) or the "Foreground" window (under Win32). This can be a main window or a dialog box.

Example

	[-] if (TextEditor.GetActive() != Find)
		[ ] Find.SetActive()