Class
DesktopApplicationWindow

Represents a window in a desktop application

Definition

Namespace:ArtOfTest.WebAii.DesktopAutomation

Assembly:ArtOfTest.WebAii.dll

Syntax:

cs-api-definition
public class DesktopApplicationWindow : IDesktopAutomationHost, IAutomationHost, ISupportSearchHost, IAnnotationHost

Inheritance: objectDesktopApplicationWindow

Implements: IAnnotationHostIAutomationHostIDesktopAutomationHostISupportSearchHost

Properties

CanMaximize

Indicates whether window can be maximized or not.

Declaration

cs-api-definition
public bool CanMaximize { get; }

Property Value

bool

CanMinimize

Indicates whether window can be minimized or not.

Declaration

cs-api-definition
public bool CanMinimize { get; }

Property Value

bool

CanMove

Indicates whether window can be moved or not.

Declaration

cs-api-definition
public bool CanMove { get; }

Property Value

bool

CanResize

Indicates whether window can be resized or not.

Declaration

cs-api-definition
public bool CanResize { get; }

Property Value

bool

CreationDate

The moment when current object was created.

Declaration

cs-api-definition
public DateTime CreationDate { get; }

Property Value

DateTime

Element

Get root desktop element.

Declaration

cs-api-definition
public DesktopElement Element { get; }

Property Value

DesktopElement

Find

Find object. Use to search desktop elements by specific properties.

Declaration

cs-api-definition
public DesktopFind Find { get; }

Property Value

DesktopFind

Implements IDesktopAutomationHost.Find

Handle

Native handle of the window.

Declaration

cs-api-definition
public IntPtr Handle { get; }

Property Value

IntPtr

IsMaximized

Indicates whether window is maximized.

Declaration

cs-api-definition
public bool IsMaximized { get; }

Property Value

bool

IsMinimized

Indicates whether window is minimized.

Declaration

cs-api-definition
public bool IsMinimized { get; }

Property Value

bool

IsModal

Indicates whether window is modal or not.

Declaration

cs-api-definition
public bool IsModal { get; }

Property Value

bool

IsTopmost

Indicates whether window is topmost or not.

Declaration

cs-api-definition
public bool IsTopmost { get; }

Property Value

bool

Name

Name of the window.

Declaration

cs-api-definition
public string Name { get; }

Property Value

string

NativeWindow

Desktop application native window.

Declaration

cs-api-definition
public Window NativeWindow { get; }

Property Value

Window

Implements IDesktopAutomationHost.NativeWindow

Methods

Capture()

Capture image of window.

Declaration

cs-api-definition
public Bitmap Capture()

Returns

Bitmap

Bitmap object containing window image

Close()

Close window.

Declaration

cs-api-definition
public void Close()

GetScreenRectangle()

Get window bounds rectangle.

Declaration

cs-api-definition
public Rectangle GetScreenRectangle()

Returns

Rectangle

Rectangle object using screen coordinates.

Maximize()

Maximize window.

Declaration

cs-api-definition
public void Maximize()

Minimize()

Minimize window.

Declaration

cs-api-definition
public void Minimize()

Move(double, double)

Move window to specific coordinates.

Declaration

cs-api-definition
public void Move(double x, double y)

Parameters

x

double

X in screen coordinates.

y

double

Y in screen coordinates.

Resize(double, double)

Resize window to new width and height.

Declaration

cs-api-definition
public void Resize(double width, double height)

Parameters

width

double

New window width.

height

double

New window height

Restore()

Restore window.

Declaration

cs-api-definition
public void Restore()

WaitForInputIdle(int)

Wait for window input to get into idle state.

Declaration

cs-api-definition
public void WaitForInputIdle(int timeout)

Parameters

timeout

int

Timeout in milliseconds.

WaitForWindowInteractionState(WindowInteractionState, int, int)

Wait for window interaction state to match a particular value.

Declaration

cs-api-definition
public bool WaitForWindowInteractionState(WindowInteractionState state, int delay = 100, int timeout = 300)

Parameters

state

WindowInteractionState

Window interaction state value to wait for.

delay

int

Delay between checks in milliseconds.

timeout

int

Max time to wait in milliseconds.

Returns

bool

True if window interaction state matches expected value into timeout interval, otherwise false.

WaitForWindowVisualState(WindowVisualState, int, int)

Wait for window visual state to match a particular value.

Declaration

cs-api-definition
public bool WaitForWindowVisualState(WindowVisualState state, int delay = 100, int timeout = 300)

Parameters

state

WindowVisualState

Window visual state value to wait for.

delay

int

Delay between checks in milliseconds.

timeout

int

Max time to wait in milliseconds.

Returns

bool

True if window visual state matches expected value into timeout interval, otherwise false.