CoreWindow CoreWindow CoreWindow CoreWindow Class

Definition

Represents the UWP app with input events and basic user interface behaviors.

public : sealed class CoreWindow : ICorePointerRedirector, ICoreWindow, ICoreWindow2, ICoreWindow3, ICoreWindow4, ICoreWindow5
public sealed class CoreWindow : ICorePointerRedirector, ICoreWindow, ICoreWindow2, ICoreWindow3, ICoreWindow4, ICoreWindow5
Public NotInheritable Class CoreWindow Implements ICorePointerRedirector, ICoreWindow, ICoreWindow2, ICoreWindow3, ICoreWindow4, ICoreWindow5
// This class does not provide a public constructor.
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

New instances of this class are obtained by calling CoreApplication.CreateNewView and then inspecting the CoreWindow property on the returned CoreApplicationView instance. Or you can obtain existing CoreWindow instances for a running app from the CoreApplication.Views property, or by calling CoreWindow.GetForCurrentThread, as seen in the following example.

void MyCoreWindowEvents::Run() // this is an implementation of IFrameworkView::Run() used to show context
{
    CoreWindow::GetForCurrentThread()->Activate();

    /...

    CoreWindow::GetForCurrentThread()->Dispatcher->ProcessEvents(CoreProcessEventsOption::ProcessUntilQuit);
}

Note

: This class is not agile, which means that you need to consider its threading model and marshaling behavior. For more info, see Threading and Marshaling (C++/CX).

Properties

ActivationMode ActivationMode ActivationMode ActivationMode

Gets a value that indicates the activation state of the window.

public : CoreWindowActivationMode ActivationMode { get; }
public CoreWindowActivationMode ActivationMode { get; }
Public ReadOnly Property ActivationMode As CoreWindowActivationMode
var coreWindowActivationMode = coreWindow.activationMode;
Value
CoreWindowActivationMode CoreWindowActivationMode CoreWindowActivationMode CoreWindowActivationMode

A value that indicates the activation state of the window.

Additional features and requirements
Device family
Windows 10 Fall Creators Update (introduced v10.0.16299.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v5)

AutomationHostProvider AutomationHostProvider AutomationHostProvider AutomationHostProvider

Gets the automation provider assigned to this window.

public : Platform::Object AutomationHostProvider { get; }
public object AutomationHostProvider { get; }
Public ReadOnly Property AutomationHostProvider As object
var object = coreWindow.automationHostProvider;
Value
Platform::Object object object object

The automation provider for this window.

Bounds Bounds Bounds Bounds

Gets the bounding rectangle of the window.

public : Rect Bounds { get; }
public Rect Bounds { get; }
Public ReadOnly Property Bounds As Rect
var rect = coreWindow.bounds;
Value
Rect Rect Rect Rect

The bounding rectangle of the window, in device-independent pixels (DIPs).

Remarks

To convert from DIPs to physical pixels (and back), use these equations (where DPI is the dots per inch value for the screen):

  • DIP value = (physical pixel x 96) / DPI
  • physical pixel value = (DIP x DPI) / 96

CustomProperties CustomProperties CustomProperties CustomProperties

Gets the set of custom properties for the window.

public : IPropertySet CustomProperties { get; }
public IPropertySet CustomProperties { get; }
Public ReadOnly Property CustomProperties As IPropertySet
var iPropertySet = coreWindow.customProperties;
Value
IPropertySet IPropertySet IPropertySet IPropertySet

The set of custom properties for the window, represented as tuples.

See Also

Dispatcher Dispatcher Dispatcher Dispatcher

Gets the event dispatcher for the window.

public : CoreDispatcher Dispatcher { get; }
public CoreDispatcher Dispatcher { get; }
Public ReadOnly Property Dispatcher As CoreDispatcher
var coreDispatcher = coreWindow.dispatcher;
Value
CoreDispatcher CoreDispatcher CoreDispatcher CoreDispatcher

The event dispatcher for the window.

See Also

DispatcherQueue DispatcherQueue DispatcherQueue DispatcherQueue

Gets the DispatcherQueue for the window.

public : DispatcherQueue DispatcherQueue { get; }
public DispatcherQueue DispatcherQueue { get; }
Public ReadOnly Property DispatcherQueue As DispatcherQueue
var dispatcherQueue = coreWindow.dispatcherQueue;
Additional features and requirements
Device family
Windows 10 Fall Creators Update (introduced v10.0.16299.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v5)

FlowDirection FlowDirection FlowDirection FlowDirection

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.

public : CoreWindowFlowDirection FlowDirection { get; set; }
public CoreWindowFlowDirection FlowDirection { get; set; }
Public ReadWrite Property FlowDirection As CoreWindowFlowDirection
var coreWindowFlowDirection = coreWindow.flowDirection;
coreWindow.flowDirection = coreWindowFlowDirection;
Value
CoreWindowFlowDirection CoreWindowFlowDirection CoreWindowFlowDirection CoreWindowFlowDirection

The flow direction of the window's reading layout.

See Also

IsInputEnabled IsInputEnabled IsInputEnabled IsInputEnabled

Gets or sets a value that indicates whether input is enabled for the app.

public : Platform::Boolean IsInputEnabled { get; set; }
public bool IsInputEnabled { get; set; }
Public ReadWrite Property IsInputEnabled As bool
var bool = coreWindow.isInputEnabled;
coreWindow.isInputEnabled = bool;
Value
Platform::Boolean bool bool bool

True if input is enabled for the app; false if it is disabled.

PointerCursor PointerCursor PointerCursor PointerCursor

Gets or sets the cursor used by the app.

public : CoreCursor PointerCursor { get; set; }
public CoreCursor PointerCursor { get; set; }
Public ReadWrite Property PointerCursor As CoreCursor
var coreCursor = coreWindow.pointerCursor;
coreWindow.pointerCursor = coreCursor;
Value
CoreCursor CoreCursor CoreCursor CoreCursor

The app's cursor.

PointerPosition PointerPosition PointerPosition PointerPosition

Gets the client coordinates of the pointer.

public : Point PointerPosition { get; set; }
public Point PointerPosition { get; set; }
Public ReadWrite Property PointerPosition As Point
var point = coreWindow.pointerPosition;
coreWindow.pointerPosition = point;
Value
Point Point Point Point

The position of the pointer in device-independent pixel (DIP).

Remarks

You cannot read the pointer position with this API when the lock screen is present.

Visible Visible Visible Visible

Gets a value that indicates whether the window is visible.

public : Platform::Boolean Visible { get; }
public bool Visible { get; }
Public ReadOnly Property Visible As bool
var bool = coreWindow.visible;
Value
Platform::Boolean bool bool bool

True if the window is visible on the screen; false if it is not.

Methods

Activate() Activate() Activate() Activate()

Activates the window. This method is called to present the window on the screen.

public : void Activate()
public void Activate()
Public Function Activate() As void
coreWindow.activate();

Remarks

The window is presented if the app is the foreground window. If the app has more than one window, the activating window is presented when the app is set to the foreground.

Close() Close() Close() Close()

Closes a secondary window and exits the message loop.

public : void Close()
public void Close()
Public Function Close() As void
coreWindow.close();

Remarks

This method also causes the ProcessEvents operation to exit the event-processing loop.

GetAsyncKeyState(VirtualKey) GetAsyncKeyState(VirtualKey) GetAsyncKeyState(VirtualKey) GetAsyncKeyState(VirtualKey)

Asynchronously retrieves the state of a virtual key.

public : CoreVirtualKeyStates GetAsyncKeyState(VirtualKey virtualKey)
public CoreVirtualKeyStates GetAsyncKeyState(VirtualKey virtualKey)
Public Function GetAsyncKeyState(virtualKey As VirtualKey) As CoreVirtualKeyStates
var coreVirtualKeyStates = coreWindow.getAsyncKeyState(virtualKey);
Parameters
virtualKey
VirtualKey VirtualKey VirtualKey VirtualKey

The virtual key for which state is returned.

Returns

The flags indicating the current state of the supplied virtual key when the input event fired.

Note

All keys support the Locked state (not just the standard Caps Lock and Num Lock keys).

See Also

GetCurrentKeyEventDeviceId() GetCurrentKeyEventDeviceId() GetCurrentKeyEventDeviceId() GetCurrentKeyEventDeviceId()

Retrieves the unique ID for the input device that generated this key event.

GetCurrentKeyEventDeviceId is not supported for all input devices.

public : Platform::String GetCurrentKeyEventDeviceId()
public string GetCurrentKeyEventDeviceId()
Public Function GetCurrentKeyEventDeviceId() As string
var string = coreWindow.getCurrentKeyEventDeviceId();
Returns
Platform::String string string string

A unique identifier for the input device associated with the key event, or an empty string. The same device can be assigned a different ID each time it is connected.

After a key event is processed, this method returns an empty string.

Additional features and requirements
Device family
Windows 10 Anniversary Edition (introduced v10.0.14393.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v3)

Remarks

Use GetCurrentKeyEventDeviceId to differentiate between devices that can generate key events, such as multiple Xbox controllers. The device id is useful for associating the input device with a specific user account.

To get a valid device ID, this method must be called from your KeyUp and KeyDown event handlers.

GetForCurrentThread() GetForCurrentThread() GetForCurrentThread() GetForCurrentThread()

Gets the CoreWindow instance for the currently active thread.

public : static CoreWindow GetForCurrentThread()
public static CoreWindow GetForCurrentThread()
Public Static Function GetForCurrentThread() As CoreWindow
var coreWindow = Windows.UI.Core.CoreWindow.getForCurrentThread();
Returns

The CoreWindow for the currently active thread.

GetKeyState(VirtualKey) GetKeyState(VirtualKey) GetKeyState(VirtualKey) GetKeyState(VirtualKey)

Retrieves the state of a virtual key.

public : CoreVirtualKeyStates GetKeyState(VirtualKey virtualKey)
public CoreVirtualKeyStates GetKeyState(VirtualKey virtualKey)
Public Function GetKeyState(virtualKey As VirtualKey) As CoreVirtualKeyStates
var coreVirtualKeyStates = coreWindow.getKeyState(virtualKey);
Parameters
virtualKey
VirtualKey VirtualKey VirtualKey VirtualKey

The virtual key for which state is returned.

Returns

The flags indicating the current state of the supplied virtual key when the input event fired.

Note

All keys support the Locked state (not just the standard Caps Lock and Num Lock keys).

See Also

ReleasePointerCapture() ReleasePointerCapture() ReleasePointerCapture() ReleasePointerCapture()

Dissociates pointer input from the app, if previously associated through SetPointerCapture, and restores normal pointer input processing.

public : void ReleasePointerCapture()
public void ReleasePointerCapture()
Public Function ReleasePointerCapture() As void
coreWindow.releasePointerCapture();

SetPointerCapture() SetPointerCapture() SetPointerCapture() SetPointerCapture()

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

public : void SetPointerCapture()
public void SetPointerCapture()
Public Function SetPointerCapture() As void
coreWindow.setPointerCapture();

Remarks

A pointer can be captured only by a single app at any time. Only the foreground window can capture the pointer. Pointer events continue even if the pointer moves outside the bounds of the app.

A pointer can only be captured when contact is detected (mouse button pressed, touch contact down, stylus in contact), and the pointer is within the bounding rectangle of the app.

The pointer is released on a PointerReleased or a PointerCaptureLost event, or ReleasePointerCapture is explicitly called.

Events

Activated Activated Activated Activated

Is fired when the window completes activation or deactivation.

public : event TypedEventHandler Activated<CoreWindow,  WindowActivatedEventArgs>
public event TypedEventHandler Activated<CoreWindow,  WindowActivatedEventArgs>
Public Event TypedEventHandler Activated( Of ( Of CoreWindow ), ( Of  WindowActivatedEventArgs ))
function onActivated(eventArgs){/* Your code */}


coreWindow.addEventListener("activated", onActivated);
coreWindow.removeEventListener("activated", onActivated);

AutomationProviderRequested AutomationProviderRequested AutomationProviderRequested AutomationProviderRequested

Is fired when a request for an automation handler is generated.

public : event TypedEventHandler AutomationProviderRequested<CoreWindow,  AutomationProviderRequestedEventArgs>
public event TypedEventHandler AutomationProviderRequested<CoreWindow,  AutomationProviderRequestedEventArgs>
Public Event TypedEventHandler AutomationProviderRequested( Of ( Of CoreWindow ), ( Of  AutomationProviderRequestedEventArgs ))
function onAutomationProviderRequested(eventArgs){/* Your code */}


coreWindow.addEventListener("automationProviderRequested", onAutomationProviderRequested);
coreWindow.removeEventListener("automationProviderRequested", onAutomationProviderRequested);

CharacterReceived CharacterReceived CharacterReceived CharacterReceived

Is fired when a new character is received by the input queue.

public : event TypedEventHandler CharacterReceived<CoreWindow,  CharacterReceivedEventArgs>
public event TypedEventHandler CharacterReceived<CoreWindow,  CharacterReceivedEventArgs>
Public Event TypedEventHandler CharacterReceived( Of ( Of CoreWindow ), ( Of  CharacterReceivedEventArgs ))
function onCharacterReceived(eventArgs){/* Your code */}


coreWindow.addEventListener("characterReceived", onCharacterReceived);
coreWindow.removeEventListener("characterReceived", onCharacterReceived);

Remarks

Apps do not receive this event when an Input Method Editor (IME) is enabled. The Input Method Editor (IME) handles all keyboard input and sets Handled to true.

Closed Closed Closed Closed

Is fired when the app terminates.

public : event TypedEventHandler Closed<CoreWindow,  CoreWindowEventArgs>
public event TypedEventHandler Closed<CoreWindow,  CoreWindowEventArgs>
Public Event TypedEventHandler Closed( Of ( Of CoreWindow ), ( Of  CoreWindowEventArgs ))
function onClosed(eventArgs){/* Your code */}


coreWindow.addEventListener("closed", onClosed);
coreWindow.removeEventListener("closed", onClosed);

Remarks

Note

Apps are typically suspended, not terminated. As a result, this event is rarely fired, if ever.

See Also

ClosestInteractiveBoundsRequested ClosestInteractiveBoundsRequested ClosestInteractiveBoundsRequested ClosestInteractiveBoundsRequested

Note

Not intended for general use.

Occurs when a framework input manager requests the bounding rectangle of an interactive element within a specific bounding rectangle and closest to a specific pointer.

public : event TypedEventHandler ClosestInteractiveBoundsRequested<CoreWindow,  ClosestInteractiveBoundsRequestedEventArgs>
public event TypedEventHandler ClosestInteractiveBoundsRequested<CoreWindow,  ClosestInteractiveBoundsRequestedEventArgs>
Public Event TypedEventHandler ClosestInteractiveBoundsRequested( Of ( Of CoreWindow ), ( Of  ClosestInteractiveBoundsRequestedEventArgs ))
function onClosestInteractiveBoundsRequested(eventArgs){/* Your code */}


coreWindow.addEventListener("closestInteractiveBoundsRequested", onClosestInteractiveBoundsRequested);
coreWindow.removeEventListener("closestInteractiveBoundsRequested", onClosestInteractiveBoundsRequested);
Additional features and requirements
Device family
Windows 10 Anniversary Edition (introduced v10.0.14393.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v3)

InputEnabled InputEnabled InputEnabled InputEnabled

Occurs when input is enabled or disabled for the app.

public : event TypedEventHandler InputEnabled<CoreWindow,  InputEnabledEventArgs>
public event TypedEventHandler InputEnabled<CoreWindow,  InputEnabledEventArgs>
Public Event TypedEventHandler InputEnabled( Of ( Of CoreWindow ), ( Of  InputEnabledEventArgs ))
function onInputEnabled(eventArgs){/* Your code */}


coreWindow.addEventListener("inputEnabled", onInputEnabled);
coreWindow.removeEventListener("inputEnabled", onInputEnabled);

KeyDown KeyDown KeyDown KeyDown

Is fired when a non-system key is pressed.

public : event TypedEventHandler KeyDown<CoreWindow,  KeyEventArgs>
public event TypedEventHandler KeyDown<CoreWindow,  KeyEventArgs>
Public Event TypedEventHandler KeyDown( Of ( Of CoreWindow ), ( Of  KeyEventArgs ))
function onKeyDown(eventArgs){/* Your code */}


coreWindow.addEventListener("keyDown", onKeyDown);
coreWindow.removeEventListener("keyDown", onKeyDown);

Remarks

Apps do not receive this event when an Input Method Editor (IME) is enabled. The Input Method Editor (IME) handles all keyboard input and sets Handled to true.

KeyUp KeyUp KeyUp KeyUp

Is fired when a non-system key is released after a press.

public : event TypedEventHandler KeyUp<CoreWindow,  KeyEventArgs>
public event TypedEventHandler KeyUp<CoreWindow,  KeyEventArgs>
Public Event TypedEventHandler KeyUp( Of ( Of CoreWindow ), ( Of  KeyEventArgs ))
function onKeyUp(eventArgs){/* Your code */}


coreWindow.addEventListener("keyUp", onKeyUp);
coreWindow.removeEventListener("keyUp", onKeyUp);

Remarks

Apps do not receive this event when an IME is enabled. The Input Method Editor (IME) handles all keyboard input and sets Handled to true.

PointerCaptureLost PointerCaptureLost PointerCaptureLost PointerCaptureLost

Occurs when a pointer moves to another app. This event is raised after PointerExited and is the final event received by the app for this pointer.

public : event TypedEventHandler PointerCaptureLost<CoreWindow,  PointerEventArgs>
public event TypedEventHandler PointerCaptureLost<CoreWindow,  PointerEventArgs>
Public Event TypedEventHandler PointerCaptureLost( Of ( Of CoreWindow ), ( Of  PointerEventArgs ))
function onPointerCaptureLost(eventArgs){/* Your code */}


coreWindow.addEventListener("pointerCaptureLost", onPointerCaptureLost);
coreWindow.removeEventListener("pointerCaptureLost", onPointerCaptureLost);
See Also

PointerEntered PointerEntered PointerEntered PointerEntered

Occurs when a pointer moves into the bounding box of the app.

public : event TypedEventHandler PointerEntered<CoreWindow,  PointerEventArgs>
public event TypedEventHandler PointerEntered<CoreWindow,  PointerEventArgs>
Public Event TypedEventHandler PointerEntered( Of ( Of CoreWindow ), ( Of  PointerEventArgs ))
function onPointerEntered(eventArgs){/* Your code */}


coreWindow.addEventListener("pointerEntered", onPointerEntered);
coreWindow.removeEventListener("pointerEntered", onPointerEntered);

Remarks

For touch input, the app receives this event before a PointerPressed event.

See Also

PointerExited PointerExited PointerExited PointerExited

Occurs when the pointer moves outside the bounding box of the app.

public : event TypedEventHandler PointerExited<CoreWindow,  PointerEventArgs>
public event TypedEventHandler PointerExited<CoreWindow,  PointerEventArgs>
Public Event TypedEventHandler PointerExited( Of ( Of CoreWindow ), ( Of  PointerEventArgs ))
function onPointerExited(eventArgs){/* Your code */}


coreWindow.addEventListener("pointerExited", onPointerExited);
coreWindow.removeEventListener("pointerExited", onPointerExited);

Remarks

For touch input, the app receives this event before a PointerReleased event.

See Also

PointerMoved PointerMoved PointerMoved PointerMoved

Occurs when a pointer moves within the bounding box of the app.

public : event TypedEventHandler PointerMoved<CoreWindow,  PointerEventArgs>
public event TypedEventHandler PointerMoved<CoreWindow,  PointerEventArgs>
Public Event TypedEventHandler PointerMoved( Of ( Of CoreWindow ), ( Of  PointerEventArgs ))
function onPointerMoved(eventArgs){/* Your code */}


coreWindow.addEventListener("pointerMoved", onPointerMoved);
coreWindow.removeEventListener("pointerMoved", onPointerMoved);
See Also

PointerPressed PointerPressed PointerPressed 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).

public : event TypedEventHandler PointerPressed<CoreWindow,  PointerEventArgs>
public event TypedEventHandler PointerPressed<CoreWindow,  PointerEventArgs>
Public Event TypedEventHandler PointerPressed( Of ( Of CoreWindow ), ( Of  PointerEventArgs ))
function onPointerPressed(eventArgs){/* Your code */}


coreWindow.addEventListener("pointerPressed", onPointerPressed);
coreWindow.removeEventListener("pointerPressed", onPointerPressed);
See Also

PointerReleased PointerReleased PointerReleased 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).

public : event TypedEventHandler PointerReleased<CoreWindow,  PointerEventArgs>
public event TypedEventHandler PointerReleased<CoreWindow,  PointerEventArgs>
Public Event TypedEventHandler PointerReleased( Of ( Of CoreWindow ), ( Of  PointerEventArgs ))
function onPointerReleased(eventArgs){/* Your code */}


coreWindow.addEventListener("pointerReleased", onPointerReleased);
coreWindow.removeEventListener("pointerReleased", onPointerReleased);

Remarks

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).

See Also

PointerRoutedAway PointerRoutedAway PointerRoutedAway PointerRoutedAway

Occurs on the process receiving input when the pointer input is routed to another process.

public : event TypedEventHandler PointerRoutedAway<ICorePointerRedirector,  PointerEventArgs>
public event TypedEventHandler PointerRoutedAway<ICorePointerRedirector,  PointerEventArgs>
Public Event TypedEventHandler PointerRoutedAway( Of ( Of ICorePointerRedirector ), ( Of  PointerEventArgs ))
function onPointerRoutedAway(eventArgs){/* Your code */}


coreWindow.addEventListener("pointerRoutedAway", onPointerRoutedAway);
coreWindow.removeEventListener("pointerRoutedAway", onPointerRoutedAway);
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10586.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v2)

Remarks

This event is not fired on a PointerReleased event.

See Also

PointerRoutedReleased PointerRoutedReleased PointerRoutedReleased PointerRoutedReleased

Occurs on a process associated with, but not currently receiving input from, a pointer that fires a PointerReleased event on a different process.

public : event TypedEventHandler PointerRoutedReleased<ICorePointerRedirector,  PointerEventArgs>
public event TypedEventHandler PointerRoutedReleased<ICorePointerRedirector,  PointerEventArgs>
Public Event TypedEventHandler PointerRoutedReleased( Of ( Of ICorePointerRedirector ), ( Of  PointerEventArgs ))
function onPointerRoutedReleased(eventArgs){/* Your code */}


coreWindow.addEventListener("pointerRoutedReleased", onPointerRoutedReleased);
coreWindow.removeEventListener("pointerRoutedReleased", onPointerRoutedReleased);
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10586.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v2)
See Also

PointerRoutedTo PointerRoutedTo PointerRoutedTo PointerRoutedTo

Occurs on the process not currently receiving input, but designated to begin receiving input from another process.

public : event TypedEventHandler PointerRoutedTo<ICorePointerRedirector,  PointerEventArgs>
public event TypedEventHandler PointerRoutedTo<ICorePointerRedirector,  PointerEventArgs>
Public Event TypedEventHandler PointerRoutedTo( Of ( Of ICorePointerRedirector ), ( Of  PointerEventArgs ))
function onPointerRoutedTo(eventArgs){/* Your code */}


coreWindow.addEventListener("pointerRoutedTo", onPointerRoutedTo);
coreWindow.removeEventListener("pointerRoutedTo", onPointerRoutedTo);
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10586.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v2)

Remarks

This event is not fired on a PointerPressed event.

See Also

PointerWheelChanged PointerWheelChanged PointerWheelChanged PointerWheelChanged

Occurs when the wheel button is rotated.

public : event TypedEventHandler PointerWheelChanged<CoreWindow,  PointerEventArgs>
public event TypedEventHandler PointerWheelChanged<CoreWindow,  PointerEventArgs>
Public Event TypedEventHandler PointerWheelChanged( Of ( Of CoreWindow ), ( Of  PointerEventArgs ))
function onPointerWheelChanged(eventArgs){/* Your code */}


coreWindow.addEventListener("pointerWheelChanged", onPointerWheelChanged);
coreWindow.removeEventListener("pointerWheelChanged", onPointerWheelChanged);
See Also

ResizeCompleted ResizeCompleted ResizeCompleted ResizeCompleted

Occurs when a user finishes resizing the window.

public : event TypedEventHandler ResizeCompleted<CoreWindow,  object>
public event TypedEventHandler ResizeCompleted<CoreWindow,  object>
Public Event TypedEventHandler ResizeCompleted( Of ( Of CoreWindow ), ( Of  object ))
function onResizeCompleted(eventArgs){/* Your code */}


coreWindow.addEventListener("resizeCompleted", onResizeCompleted);
coreWindow.removeEventListener("resizeCompleted", onResizeCompleted);
Additional features and requirements
Device family
Windows 10 Creators Update (introduced v10.0.15063.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v4)

ResizeStarted ResizeStarted ResizeStarted ResizeStarted

Occurs when a user starts to resize the window.

public : event TypedEventHandler ResizeStarted<CoreWindow,  object>
public event TypedEventHandler ResizeStarted<CoreWindow,  object>
Public Event TypedEventHandler ResizeStarted( Of ( Of CoreWindow ), ( Of  object ))
function onResizeStarted(eventArgs){/* Your code */}


coreWindow.addEventListener("resizeStarted", onResizeStarted);
coreWindow.removeEventListener("resizeStarted", onResizeStarted);
Additional features and requirements
Device family
Windows 10 Creators Update (introduced v10.0.15063.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v4)

SizeChanged SizeChanged SizeChanged SizeChanged

Occurs when the window size is changed.

public : event TypedEventHandler SizeChanged<CoreWindow,  WindowSizeChangedEventArgs>
public event TypedEventHandler SizeChanged<CoreWindow,  WindowSizeChangedEventArgs>
Public Event TypedEventHandler SizeChanged( Of ( Of CoreWindow ), ( Of  WindowSizeChangedEventArgs ))
function onSizeChanged(eventArgs){/* Your code */}


coreWindow.addEventListener("sizeChanged", onSizeChanged);
coreWindow.removeEventListener("sizeChanged", onSizeChanged);

Remarks

The SizeChanged event is exposed to XAML apps as the Window.SizeChanged event and to HTML apps as the window.resize event.

This event occurs when the window size changes or when one of the following properties changes:

TouchHitTesting TouchHitTesting TouchHitTesting TouchHitTesting

Occurs when a touch contact area intersects the bounding rectangle (or polygon) of a window that is registered for touch hit testing.

public : event TypedEventHandler TouchHitTesting<CoreWindow,  TouchHitTestingEventArgs>
public event TypedEventHandler TouchHitTesting<CoreWindow,  TouchHitTestingEventArgs>
Public Event TypedEventHandler TouchHitTesting( Of ( Of CoreWindow ), ( Of  TouchHitTestingEventArgs ))
function onTouchHitTesting(eventArgs){/* Your code */}


coreWindow.addEventListener("touchHitTesting", onTouchHitTesting);
coreWindow.removeEventListener("touchHitTesting", onTouchHitTesting);

VisibilityChanged VisibilityChanged VisibilityChanged VisibilityChanged

Is fired when the window visibility is changed.

public : event TypedEventHandler VisibilityChanged<CoreWindow,  VisibilityChangedEventArgs>
public event TypedEventHandler VisibilityChanged<CoreWindow,  VisibilityChangedEventArgs>
Public Event TypedEventHandler VisibilityChanged( Of ( Of CoreWindow ), ( Of  VisibilityChangedEventArgs ))
function onVisibilityChanged(eventArgs){/* Your code */}


coreWindow.addEventListener("visibilityChanged", onVisibilityChanged);
coreWindow.removeEventListener("visibilityChanged", onVisibilityChanged);

See Also