AppInstance.GetInstances 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
擷取所有執行中的應用程式實例集合。
public:
static IVector<AppInstance ^> ^ GetInstances();
/// [Windows.Foundation.Metadata.Experimental]
static IVector<AppInstance> GetInstances();
static IVector<AppInstance> GetInstances();
[Windows.Foundation.Metadata.Experimental]
public static IList<AppInstance> GetInstances();
public static IList<AppInstance> GetInstances();
function getInstances()
Public Shared Function GetInstances () As IList(Of AppInstance)
傳回
所有執行中的應用程式實例的集合。
- 屬性
備註
而 Windows 則是這樣。Windows 作業系統中的 ApplicationModel.AppInstance.GetInstances 方法只會回傳已明確註冊多實例重定向的應用程式實例,使用 FindOrRegisterInstanceForKey 方法;而 Windows 應用程式 SDK 中此方法則回傳所有已呼叫任何 AppInstance 方法的執行中應用程式實例清單。 通常,應用程式實例會呼叫 AppInstance.GetCurrent,這會做兩件事:一是將目前實例加入 GetInstances 方法會回傳的清單,二是回傳目前的實例。