CoreWindow Class

Définit un objet window et ses événements d'entrée, ainsi que les comportements de l'interface utilisateur de base.

Syntaxe


public sealed class CoreWindow : Object,
    ICoreWindow

Attributs

MarshalingBehaviorAttribute(Standard)
MuseAttribute()
StaticAttribute(Windows.UI.Core.ICoreWindowStatic, NTDDI_WIN8)
VersionAttribute(NTDDI_WIN8)
WebHostHiddenAttribute()

Membres

CoreWindowClasse comporte les types de membres suivants :

Événements

CoreWindowClasse comporte les événements suivants.

ÉvénementDescription
Activated Is fired when the window completes activation or deactivation.
AutomationProviderRequested Is fired when a request for an automation handler is generated.
CharacterReceived Is fired when a new character is received by the input queue.
Closed Is fired when the app terminates.
InputEnabled Occurs when input is enabled or disabled for the window.
KeyDown Is fired when a non-system key is pressed.
KeyUp Is fired when a non-system key is released after a press.
PointerCaptureLost Occurs when a pointer moves to another window.
PointerEntered Occurs when a pointer moves into the bounding box of the window.
PointerExited Occurs when the pointer moves outside the bounding box of the window.
PointerMoved 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.
PointerReleased Occurs when a mouse button is released or the finger or pen is lifted from the digitizer surface.
PointerWheelChanged Occurs when the mouse wheel is rotated.
SizeChanged Is fired when the window size is changed.
TouchHitTesting Occurs when a touch contact area intersects the bounding rectangle (or polygon) of a window that is registered for touch hit testing.
VisibilityChanged Is fired when the window visibility is changed.

 

Méthodes

The CoreWindow Classe comporte les méthodes suivantes. Il hérite également des méthodes de Object Classe.

MéthodeDescription
Activate Activates the window.
Close Closes a secondary window and exits the message loop.
GetAsyncKeyState Returns the state of a virtual key asynchronously.
GetForCurrentThread Gets the CoreWindow instance for the currently active thread.
GetKeyState Gets the state of a key.
ReleasePointerCapture Disables pointer capture for the window.
SetPointerCapture Enables pointer capture for the window.

 

Propriétés

Le CoreWindowClasse contient les propriétés suivantes.

PropriétéType d’accèsDescription

AutomationHostProvider

en lecture seuleGets the automation provider assigned to this window.

Bounds

en lecture seuleGets the bounding rectangle of the window.

CustomProperties

en lecture seuleGets the set of custom properties for the window.

Dispatcher

en lecture seuleGets the event dispatcher for the window.

FlowDirection

en lecture/écritureGets or sets the horizontal origin of the window's reading order alignment.

IsInputEnabled

en lecture/écritureGets or sets a value that indicates whether input is enabled for the window.

PointerCursor

en lecture/écritureGets or sets the cursor used by the window.

PointerPosition

en lecture seuleGets the position of the pointer.

Visible

en lecture seuleGets a value that indicates whether the window is visible.

 

Remarques

De nouvelles instances de cette classe sont obtenues en appelant CoreApplication.CreateNewView et en examinant la propriété CoreWindow de l'instance CoreApplicationView retournée. Vous pouvez obtenir des instances CoreWindow existantes pour une application en cours d'exécution à partir de la propriété CoreApplication.Views , ou en appelant CoreWindow.GetForCurrentThread, comme indiqué dans l'exemple suivant.


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

    /...

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

Remarque   : cette classe n'est pas agile, ce qui signifie que vous devez prendre en compte son modèle de thread et son comportement de marshaling. Pour plus d'informations, consultez Threads et marshaling (C++/CX).

Configuration requise

Client minimal pris en charge

Windows 8 [Applications du Windows Store uniquement]

Serveur minimal pris en charge

Windows Server 2012 [Applications du Windows Store uniquement]

Téléphone minimal pris en charge

Windows Phone 8

Espace de noms

Windows.UI.Core
Windows::UI::Core [C++]

Métadonnées

Windows.winmd

Voir aussi

CoreApplicationView
CoreApplication.CreateNewView
CoreApplication.Views

 

 

Afficher:
© 2014 Microsoft