共用方式為


WindowActivatedEventArgs 類別

定義

包含 CoreWindow.Activated 事件所傳回的 Windows 啟用狀態資訊。

public ref class WindowActivatedEventArgs sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Standard)]
class WindowActivatedEventArgs final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Standard)]
public sealed class WindowActivatedEventArgs
Public NotInheritable Class WindowActivatedEventArgs
繼承
Object Platform::Object IInspectable WindowActivatedEventArgs
屬性
實作

Windows 需求

裝置系列
Windows 10 (已於 10.0.10240.0 引進)
API contract
Windows.Foundation.UniversalApiContract (已於 v1.0 引進)

範例

void SetWindow(CoreWindow const & window)
{
    ...
    window.Activated({ this, &App::OnActivated });
}

// Activation event data in WindowActivatedEventArgs.
void OnActivated(Windows::UI::Core::CoreWindow const& /* sender */, Windows::UI::Core::WindowActivatedEventArgs const& /* args */) {}
// returning window activation events data through WindowActivatedEventArgs
void MyCoreWindowEvents::SetWindow( // implementation called by CoreApplication::Run(), provided for context
    _In_ CoreWindow^ window
    )
{
    // ...
    window->Activated +=
        ref new TypedEventHandler<CoreWindow^, WindowActivatedEventArgs^>(this, &CoreWindowEvents::OnWindowActivated);
    // ...
}

備註

此物件是由針對 CoreWindow.Activated 事件註冊的委派所傳回。

注意

這個類別不是敏捷式的,這表示您需要考慮其執行緒模型和封送處理行為。 如需詳細資訊,請參閱 執行緒和封送處理 (C++/CX)

屬性

Handled

指定屬性,這個屬性會取得或設定是否處理視窗啟用事件。

WindowActivationState

取得引發 Activated 事件時視窗的啟用狀態。

適用於

另請參閱