ICoreWindow Interface

Definition

Specifies an interface for a window object and its input events as well as basic user interface behaviors.

public interface class ICoreWindow
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.Guid(2042222066, 34718, 19337, 183, 152, 121, 228, 117, 152, 3, 12)]
struct ICoreWindow
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.Guid(2042222066, 34718, 19337, 183, 152, 121, 228, 117, 152, 3, 12)]
public interface ICoreWindow
Public Interface ICoreWindow
Derived
Attributes

Windows requirements

Device family
Windows 10 (introduced in 10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v1.0)

Properties

AutomationHostProvider

Specifies the property that gets the automation provider assigned to this window.

Bounds

Specifies the property that gets the bounding rectangle of the window.

CustomProperties

Specifies a property that gets the set of custom properties for the window.

Dispatcher

Specifies a property that gets the event dispatcher for the window.

FlowDirection

Specifies the property that gets or sets the horizontal origin of the window's reading order alignment. If the language specified by the user interface is right-aligned (such as in Arabic or Hebrew), the horizontal origin of the reading layout for the window is on the right edge.

IsInputEnabled

Specifies a property that gets or sets whether input is enabled for the window.

PointerCursor

Gets or sets the pointer cursor used by the window.

PointerPosition

Specifies a property that gets the position of the pointer.

Visible

Specifies the property that gets whether the window is visible or not.

Methods

Activate()

Specifies a method that activates the window. This method is called to present the window on the screen.

Close()

Specifies the method that closes the window and exits the message loop.

GetAsyncKeyState(VirtualKey)

Specifies a method that returns the state of a virtual key asynchronously.

GetKeyState(VirtualKey)

Specifies a method that gets the state of a key.

ReleasePointerCapture()

Specifies a method that dissociates pointer input from the app, if previously associated through SetPointerCapture, and restores normal pointer input processing.

SetPointerCapture()

Specifies a method that associates pointer input with the app. Once a pointer is captured, all subsequent events associated with that pointer are fired by the app.

A pointer can be captured only by a single app at any time.

Pointer events continue even if the pointer moves outside the bounds of the app.

Events

Activated

Specifies the event that is fired when the window completes activation or deactivation.

AutomationProviderRequested

Specifies the event that is fired when a request for an automation handler is generated.

CharacterReceived

Specifies the event that is fired when a new character is received by the input queue.

Closed

Specifies the event that is fired when a window is closed (or the app terminates altogether).

InputEnabled

Specifies an event that occurs when input is enabled or disabled for the window.

KeyDown

The event that's raised when a non-system key is pressed.

The delegate type for this event is TypedEventHandler<TSender,TResult>, where TSender is of type CoreWindow, and TResult is of type KeyEventArgs.

KeyUp

The event that's raised when a non-system key is released after a press.

The delegate type for this event is TypedEventHandler<TSender,TResult>, where TSender is of type CoreWindow, and TResult is of type KeyEventArgs.

PointerCaptureLost

Specifies the event that occurs when a pointer moves to another window. This event is fired after PointerExited and is the final pointer event that is raised for a window.

PointerEntered

Specifies the event that occurs when a pointer moves into the bounding box of the window.

PointerExited

Specifies the event that occurs when the pointer moves outside the bounding box of the window.

PointerMoved

Specifies the event that occurs when a pointer moves within the bounding box of the window.

PointerPressed

Occurs when a mouse button is clicked, or the digitizer surface has been touched by a finger or pen, within the bounding rectangle of the app.

An interaction session starts when a single contact is detected and ends when that contact, and all subsequent contacts in the same session, are no longer detected.

This event is fired for the first contact detected in the interaction session. Details for all other concurrent contact pointers are exposed through a PointerPointProperties object (obtained by getting the Properties property from a PointerPoint object).

PointerReleased

Occurs when a pressed mouse button is released, or a touch or pen contact is lifted from the digitizer surface, within the bounding rectangle of the app (or outside the bounding rectangle, if the pointer is captured).

An interaction session starts when a single contact is detected and ends when that contact, and all subsequent contacts in the same session, are no longer detected.

This event is fired for each contact detected in the interaction session (except for mouse, where this event is fired only when the last mouse button is released).

PointerWheelChanged

The event that's raised when the mouse wheel is rotated.

The delegate type for this event is TypedEventHandler<TSender,TResult>, where TSender is of type CoreWindow, and TResult is of type PointerEventArgs.

SizeChanged

Specifies the event that raises when the window size is changed.

TouchHitTesting

Specifies the event that occurs when a touch contact area falls within a window that is registered for touch hit testing.

VisibilityChanged

Specifies the event that occurs when the window visibility is changed.

Applies to