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
elementElementThe element to create the adapter for.
Exceptions
- NullReferenceException
If
elementisnull.- 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
AutomationControlName
The name of the Windows Forms control.
public virtual string AutomationControlName { get; }
Property Value
AutomationId
The Automation Id of the element.
public virtual string AutomationId { get; }
Property Value
Class
The name of the native window class.
public virtual string Class { get; }
Property Value
ControlId
The control id of the window.
public virtual int ControlId { get; }
Property Value
ControlName
public virtual string ControlName { get; }
Property Value
Handle
The handle of the native window.
public virtual IntPtr Handle { get; }
Property Value
Instance
The instance number of the window for a given class with respect to its siblings.
public virtual int Instance { get; }
Property Value
ProcessId
The process id of the process that owns the native window.
public virtual int ProcessId { get; }
Property Value
ProcessName
The process name of the process that owns the native window.
public virtual string ProcessName { get; }
Property Value
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
WindowStyle
The style of the window.
[CLSCompliant(false)]
public virtual Win32.WindowStyles WindowStyle { get; }
Property Value
WindowText
The text of the window.
public virtual string WindowText { get; }
Property Value
Methods
FromElement(Element)
Converts an Element to an instance of this class.
public static NativeWindow FromElement(Element element)
Parameters
elementElementThe element to convert.
Returns
- NativeWindow
The NativeWindow.
Exceptions
- ArgumentNullException
If
elementisnull.- 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
pathstringThe search path.
Returns
- NativeWindow
The NativeWindow.
Remarks
The DefaultSearchTimeout is used to search for the specified path.
Exceptions
- ArgumentNullException
If
pathisnull.- RxPathException
If the specified
pathis 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
elementElementThe element to convert.
Returns
- NativeWindow
The NativeWindow.
Exceptions
- ArgumentNullException
If
elementisnull.- 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
pathstringThe search path.
Returns
- NativeWindow
The NativeWindow.
Remarks
The DefaultSearchTimeout is used to search for the specified path.
Exceptions
- ArgumentNullException
If
pathisnull.- RxPathException
If the specified
pathis not valid.- ElementNotFoundException
If no element is found.
- CapabilityNotSupportedException
If the element does not support the capabilities required by this adapter.