Table of Contents

Class NativeWindow

Namespace
Ranorex
Assembly
Ranorex.Plugin.Win32.dll

This element is a native win32 window or control.

public class NativeWindow : Adapter, IAdapter
Inheritance
NativeWindow
Implements
Inherited Members

Constructors

NativeWindow()

Creates a new NativeWindow adapter instance. This constructor is used internally by the Ranorex Core Framework for performance issues!

protected NativeWindow()

NativeWindow(Element)

Creates a new NativeWindow adapter instance.

public NativeWindow(Element element)

Parameters

element Element

The element to create the adapter for.

Exceptions

NullReferenceException

If element is null.

CapabilityNotSupportedException

If the element does not support the capabilities required by this adapter.

Properties

AppHung

A flag which represents if the application the window belongs to seems to be hanging.

public virtual bool AppHung { get; }

Property Value

bool

AutomationControlName

The name of the Windows Forms control.

public virtual string AutomationControlName { get; }

Property Value

string

AutomationId

The Automation Id of the element.

public virtual string AutomationId { get; }

Property Value

string

Class

The name of the native window class.

public virtual string Class { get; }

Property Value

string

ControlId

The control id of the window.

public virtual int ControlId { get; }

Property Value

int

ControlName

public virtual string ControlName { get; }

Property Value

string

Handle

The handle of the native window.

public virtual IntPtr Handle { get; }

Property Value

IntPtr

Instance

The instance number of the window for a given class with respect to its siblings.

public virtual int Instance { get; }

Property Value

int

ProcessId

The process id of the process that owns the native window.

public virtual int ProcessId { get; }

Property Value

int

ProcessName

The process name of the process that owns the native window.

public virtual string ProcessName { get; }

Property Value

string

RequiredCapabilities

Capabilities required by the adapter implementation.

protected override string[] RequiredCapabilities { get; }

Property Value

string[]

WindowExtendedStyle

The extended style of the window.

[CLSCompliant(false)]
public virtual Win32.WindowExtendedStyles WindowExtendedStyle { get; }

Property Value

Win32.WindowExtendedStyles

WindowStyle

The style of the window.

[CLSCompliant(false)]
public virtual Win32.WindowStyles WindowStyle { get; }

Property Value

Win32.WindowStyles

WindowText

The text of the window.

public virtual string WindowText { get; }

Property Value

string

Methods

FromElement(Element)

Converts an Element to an instance of this class.

public static NativeWindow FromElement(Element element)

Parameters

element Element

The element to convert.

Returns

NativeWindow

The NativeWindow.

Exceptions

ArgumentNullException

If element is null.

CapabilityNotSupportedException

If the element does not support the capabilities required by this adapter.

FromPath(string)

Converts a string to an instance of this class by searching the root.

public static NativeWindow FromPath(string path)

Parameters

path string

The search path.

Returns

NativeWindow

The NativeWindow.

Remarks

The DefaultSearchTimeout is used to search for the specified path.

Exceptions

ArgumentNullException

If path is null.

RxPathException

If the specified path is not valid.

ElementNotFoundException

If no element is found.

CapabilityNotSupportedException

If the element does not support the capabilities required by this adapter.

Operators

implicit operator NativeWindow(Element)

Implicitly converts an Element to an instance of this class.

public static implicit operator NativeWindow(Element element)

Parameters

element Element

The element to convert.

Returns

NativeWindow

The NativeWindow.

Exceptions

ArgumentNullException

If element is null.

CapabilityNotSupportedException

If the element does not support the capabilities required by this adapter.

implicit operator NativeWindow(string)

Implicitly converts a string to an instance of this class by searching the root.

public static implicit operator NativeWindow(string path)

Parameters

path string

The search path.

Returns

NativeWindow

The NativeWindow.

Remarks

The DefaultSearchTimeout is used to search for the specified path.

Exceptions

ArgumentNullException

If path is null.

RxPathException

If the specified path is not valid.

ElementNotFoundException

If no element is found.

CapabilityNotSupportedException

If the element does not support the capabilities required by this adapter.