Interface IWindow
Used to interact with OS windows.
All values returned by properties of IWindow
represent real (unscaled by DPI settings) values.
All operations can throw InvalidWindowReferenceException at any time.
Your code should be able to handle this gracefully.
All property reads return default but valid values once the window is dead and never
throw InvalidWindowReferenceException.
Inherited Members
System.IEquatable<WinMan.IWindow>.Equals(WinMan.IWindow)
Assembly: WinMan.dll
Syntax
public interface IWindow : IEquatable<IWindow>
Properties
|
Improve this Doc
View Source
CanClose
True if the window can be closed by the current process.
Declaration
Property Value
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
CanMaximize
True if the window supports maximization.
Returns false once the window is dead (IsAlive=false).
Declaration
bool CanMaximize { get; }
Property Value
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
CanMinimize
True if the window supports minimization.
Returns false once the window is dead (IsAlive=false).
Declaration
bool CanMinimize { get; }
Property Value
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
CanMove
True if the window can be moved.
Returns false once the window is dead (IsAlive=false).
Declaration
Property Value
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
CanReorder
True if the window can be reordered in the visual hierarchy.
Declaration
Property Value
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
CanResize
True if the window is resizable.
Returns false once the window is dead (IsAlive=false).
Declaration
Property Value
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
FrameMargins
Declaration
Rectangle FrameMargins { get; }
Property Value
|
Improve this Doc
View Source
Handle
The OS-specific window handle.
Returns IntPtr.Zero once the window is dead (IsAlive=false).
Declaration
Property Value
Type |
Description |
System.IntPtr |
|
|
Improve this Doc
View Source
IsAlive
Is the window instance alive.
Declaration
Property Value
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
IsFocused
Is this the foreground window.
Returns false once the window is dead (IsAlive=false).
Declaration
Property Value
Type |
Description |
System.Boolean |
|
Exceptions
|
Improve this Doc
View Source
IsTopmost
True if the window is always drawn above other non-topmost windows.
Returns false once the window is dead (IsAlive=false).
Declaration
Property Value
Type |
Description |
System.Boolean |
|
Exceptions
|
Improve this Doc
View Source
MaxSize
The maxmimum allowed size for this window.
Declaration
Property Value
Type |
Description |
System.Nullable<Point> |
|
Exceptions
Type |
Condition |
System.Runtime.InteropServices.ExternalException |
|
|
Improve this Doc
View Source
MinSize
The minimum allowed size for this window.
Declaration
Property Value
Type |
Description |
System.Nullable<Point> |
|
Exceptions
Type |
Condition |
System.Runtime.InteropServices.ExternalException |
|
|
Improve this Doc
View Source
Position
The client rectangle of the window, relative to the workarea.
Returns Rectangle.Empty once the window is dead (IsAlive=false).
Declaration
Rectangle Position { get; }
Property Value
Exceptions
Type |
Condition |
System.Runtime.InteropServices.ExternalException |
|
|
Improve this Doc
View Source
State
The current state of the window.
Returns WindowState.Minimized once the window is dead (IsAlive=false).
Declaration
WindowState State { get; }
Property Value
Exceptions
Type |
Condition |
System.Runtime.InteropServices.ExternalException |
|
System.InvalidOperationException |
If the window cannot be changed to that state due to other reasons.
|
|
Improve this Doc
View Source
SyncRoot
The internal synchronisation object.
Declaration
Property Value
Type |
Description |
System.Object |
|
|
Improve this Doc
View Source
Title
The title of the window.
Returns string.Empty once the window is dead (IsAlive=false).
Declaration
Property Value
Type |
Description |
System.String |
|
Exceptions
Type |
Condition |
System.Runtime.InteropServices.ExternalException |
|
|
Improve this Doc
View Source
Workspace
The IWorkspace which returned this IWindow instance.
Declaration
IWorkspace Workspace { get; }
Property Value
Methods
|
Improve this Doc
View Source
BringToFront()
Positions the window in front of all other non-topmost windows.
Declaration
Exceptions
|
Improve this Doc
View Source
Close()
Sends a close event to the window.
Declaration
Exceptions
|
Improve this Doc
View Source
GetNextWindow()
Gets the next window in the workspace. The previous window is the window below this one.
Declaration
Returns
Exceptions
|
Improve this Doc
View Source
GetPreviousWindow()
Gets the previous window in the workspace. The previous window is the window above this one.
Declaration
IWindow GetPreviousWindow()
Returns
Exceptions
|
Improve this Doc
View Source
GetProcess()
Returns the process the window belongs to.
Declaration
Returns
Type |
Description |
System.Diagnostics.Process |
|
Exceptions
|
Improve this Doc
View Source
InsertAfter(IWindow)
Moves the current window to be positioned after the given one in the z-order.
Declaration
void InsertAfter(IWindow other)
Parameters
Type |
Name |
Description |
IWindow |
other |
|
Exceptions
|
Improve this Doc
View Source
RequestFocus()
Declaration
Exceptions
|
Improve this Doc
View Source
SendToBack()
Positions the window behind all other non-topmost windows.
Declaration
Exceptions
|
Improve this Doc
View Source
SetPosition(Rectangle)
Changes the location of the window.
Declaration
void SetPosition(Rectangle newLocation)
Parameters
Exceptions
|
Improve this Doc
View Source
SetState(WindowState)
Changes the state of the window.
Declaration
void SetState(WindowState state)
Parameters
Exceptions
|
Improve this Doc
View Source
SetTopmost(Boolean)
Changes the topmost property of the window.
Declaration
void SetTopmost(bool topmost)
Parameters
Type |
Name |
Description |
System.Boolean |
topmost |
|
Exceptions
Events
|
Improve this Doc
View Source
Added
The window was added to the workspace.
Declaration
event EventHandler<WindowChangedEventArgs> Added
Event Type
|
Improve this Doc
View Source
Destroyed
The window instance was destroyed.
IsAlive will be false.
Declaration
event EventHandler<WindowChangedEventArgs> Destroyed
Event Type
|
Improve this Doc
View Source
GotFocus
The window became the foreground window.
Declaration
event EventHandler<WindowFocusChangedEventArgs> GotFocus
Event Type
|
Improve this Doc
View Source
LostFocus
Declaration
event EventHandler<WindowFocusChangedEventArgs> LostFocus
Event Type
|
Improve this Doc
View Source
PositionChanged
The position of the window has changed. This might be due to a user interaction
or through some form of scripted behaviour.
Declaration
event EventHandler<WindowPositionChangedEventArgs> PositionChanged
Event Type
|
Improve this Doc
View Source
PositionChangeEnd
Event emitted when the user interaction driving the resize or move of
the window ends.
Declaration
event EventHandler<WindowPositionChangedEventArgs> PositionChangeEnd
Event Type
|
Improve this Doc
View Source
PositionChangeStart
Event emitted when the window position starts changing as a result of
user interaction (resize or move).
Declaration
event EventHandler<WindowPositionChangedEventArgs> PositionChangeStart
Event Type
|
Improve this Doc
View Source
Removed
The window was removed from the workspace.
IsAlive is likely to be false.
Declaration
event EventHandler<WindowChangedEventArgs> Removed
Event Type
|
Improve this Doc
View Source
StateChanged
The state of the window has changed.
Declaration
event EventHandler<WindowStateChangedEventArgs> StateChanged
Event Type
|
Improve this Doc
View Source
TitleChanged
The title of the window has changed.
Declaration
event EventHandler<WindowTitleChangedEventArgs> TitleChanged
Event Type
|
Improve this Doc
View Source
TopmostChanged
The IsTopmost property of the window has changed.
Declaration
event EventHandler<WindowTopmostChangedEventArgs> TopmostChanged
Event Type