Udostępnij za pośrednictwem


InstalledDesktopApp Class

Definition

Provides a list of installed Win32 apps available to the current user. This includes apps installed for all users as well as only for the current user.

public ref class InstalledDesktopApp sealed : IStringable
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 393216)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class InstalledDesktopApp final : IStringable
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 393216)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class InstalledDesktopApp : IStringable
Public NotInheritable Class InstalledDesktopApp
Implements IStringable
Inheritance
Object Platform::Object IInspectable InstalledDesktopApp
Attributes
Implements

Windows requirements

Device family
Windows 10, version 1803 (introduced in 10.0.17134.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v6.0)
App capabilities
packageQuery

Examples

IReadOnlyList<IInstalledDesktopApp> installedApps = await InstalledDesktopApp.GetInventoryAsync();

foreach (var app in installedApps)
{
    Console.WriteLine("Display Name: " + app.DisplayName);
    Console.WriteLine("Application ID: " + app.Id);
    Console.WriteLine("Publisher: " + app.Publisher);
    Console.WriteLine("Display Version: " + app.DisplayVersion);
}

Remarks

InstalledDesktopApp checks for the packageQuery capability and returns an empty vector if the capability isn’t held by the caller.

Properties

DisplayName

Gets the display name of the installed desktop app.

DisplayVersion

Gets the string-based version of the installed desktop app.

Id

Gets the string-based ID of the installed desktop app.

Publisher

Gets the publisher of the installed desktop app.

Methods

GetInventoryAsync()

Gets a list of installed Win32 apps available to the current user. This includes apps installed for all users as well as only for the current user.

ToString()

Returns a string that represents the current InstalledDesktopApp object.

Applies to