AppWindow 類別

定義

代表應用程式內容的系統管理容器。

public ref class AppWindow sealed
/// [Windows.Foundation.Metadata.ContractVersion(Microsoft.Foundation.WindowsAppSDKContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class AppWindow final
[Windows.Foundation.Metadata.ContractVersion(typeof(Microsoft.Foundation.WindowsAppSDKContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class AppWindow
Public NotInheritable Class AppWindow
繼承
Object Platform::Object IInspectable AppWindow
屬性

備註

重要

自 Windows 應用程式 SDK 1.2 起,Windows 10 部分支援標題列自定義 API,且完全支援 Windows 11。 您應該先檢查程序代碼中的 AppWindowTitleBar.IsCustomizationSupported ,再呼叫這些 API,以確保您的應用程式不會在其他版本的 Windows 上當機。 如需詳細資訊 ,請參閱標題列自定義

屬性

ClientSize

取得 Win32 用戶端座標中視窗工作區的目前大小。

DispatcherQueue

取得與應用程式視窗相關聯的發送器佇列。

Id

取得應用程式視窗的識別碼。

IsShownInSwitchers

取得或設定值,這個值表示這個視窗是否會出現在各種系統表示法中,例如ALT+TAB和任務列。

IsVisible

取得值,這個值表示是否顯示視窗。

OwnerWindowId

取得此視窗擁有者的識別碼;如果未擁有,則為 0。

Position

取得視窗在螢幕座標中的目前位置。

Presenter

取得應用程式視窗目前套用的演示者。

Size

取得螢幕座標中視窗的目前大小。

Title

取得或設定應用程式視窗的顯示標題。

TitleBar

取得應用程式視窗的標題列。

方法

AssociateWithDispatcherQueue(DispatcherQueue)

將應用程式視窗與指定的發送器佇列產生關聯。

Create()

建立應用程式視窗,並將樣式和屬性設定為預設 OverlappedPresenter的樣式和屬性。

Create(AppWindowPresenter)

使用指定的 中所 AppWindowPresenter定義的樣式和屬性建立視窗。

Create(AppWindowPresenter, WindowId)

建立樣式和屬性的視窗,如指定的 AppWindowPresenter 和父系所定義的指定視窗。

Create(AppWindowPresenter, WindowId, DispatcherQueue)

使用指定的 AppWindowPresenter中定義的樣式和屬性建立視窗,其父系為指定的視窗,並與指定的 DispatcherQueue相關聯。

Destroy()

嘗試終結應用程式視窗。

GetFromWindowId(WindowId)

AppWindow如果有的話,傳回具有指定 WindowId之 的 。 如果 WindowId 無法比對至有效的視窗,則傳null回 。

Hide()

隱藏系統中所有UX表示法的視窗,但讓物件保持運作。

Move(PointInt32)

將視窗移至螢幕座標的指定點。

MoveAndResize(RectInt32)

將視窗移至螢幕座標的指定點,並將它設定為指定的大小。

MoveAndResize(RectInt32, DisplayArea)

將視窗移至指定顯示區域內的指定點,並將它設定為指定的大小。

MoveInZOrderAtBottom()

將目前的視窗移至 Z 順序中的下層視窗。

MoveInZOrderAtTop()

將目前的視窗移至 Z 順序中的頂端視窗。

MoveInZOrderBelow(WindowId)

將目前視窗移至 Z 順序中的指定視窗下方。

Resize(SizeInt32)

將視窗大小調整為指定的大小。

ResizeClient(SizeInt32)

調整視窗的大小,以容納工作區的指定大小。

SetIcon(IconId)

使用指定的圖示標識碼,設定視窗的圖示。

SetIcon(String)

使用指定的圖示路徑,設定視窗的圖示。

SetPresenter(AppWindowPresenter)

將指定的演示者套用至視窗。

SetPresenter(AppWindowPresenterKind)

將指定的演示者種類套用至視窗。

Show()

顯示視窗並加以啟動。

Show(Boolean)

顯示有選項可啟動視窗的視窗。

ShowOnceWithRequestedStartupState()

顯示具有要求狀態之預設演示者的視窗。

事件

Changed

發生於視窗的 屬性已變更,而且系統目前處於「穩定狀態」時。

Closing

當視窗透過系統能供性關閉時發生。

Destroying

當視窗損毀時發生。

適用於

另請參閱