Delen via


LauncherOptions Class

Definition

Specifies the options used to launch the default app for a file or URI.

In a desktop app, before using an instance of this class in a way that displays UI, you'll need to associate the object with its owner's window handle. For more info, and code examples, see Display WinRT UI objects that depend on CoreWindow.

public ref class LauncherOptions sealed : ILauncherViewOptions
/// [Windows.Foundation.Metadata.Activatable(65536, Windows.Foundation.UniversalApiContract)]
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
class LauncherOptions final : ILauncherViewOptions
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Activatable(65536, "Windows.Foundation.UniversalApiContract")]
class LauncherOptions final : ILauncherViewOptions
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Activatable(65536, "Windows.Foundation.UniversalApiContract")]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class LauncherOptions final : ILauncherViewOptions
[Windows.Foundation.Metadata.Activatable(65536, typeof(Windows.Foundation.UniversalApiContract))]
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
public sealed class LauncherOptions : ILauncherViewOptions
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Activatable(65536, "Windows.Foundation.UniversalApiContract")]
public sealed class LauncherOptions : ILauncherViewOptions
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Activatable(65536, "Windows.Foundation.UniversalApiContract")]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class LauncherOptions : ILauncherViewOptions
function LauncherOptions()
Public NotInheritable Class LauncherOptions
Implements ILauncherViewOptions
Inheritance
Object Platform::Object IInspectable LauncherOptions
Attributes
Implements

Windows requirements

Device family
Windows 10 (introduced in 10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v1.0)

Examples

See the code example in the LaunchUriAsync(Uri, LauncherOptions) topic.

Remarks

In some cases, when you call Launcher static methods to launch an app associated with a file type or URI protocol, you must specify exactly which app you want to be launched by passing a LauncherOptions parameter with the TargetApplicationPackageFamilyName property set to the package family name for the app package containing that app.

Two such cases are as follows:

  1. You want to launch an app with a URI and pass extra input data to the launched app, using Launcher.LaunchUriAsync(Uri, LauncherOptions, ValueSet).
  2. You want to launch an app with a URI and wait for the app to send output data back to your app, using any overload of Launcher.LaunchUriForResultsAsync.

In these cases, both the calling app and launched app need to agree on how to interpret the extra data passed from one app to the other. The calling app cannot launch any app that happens to be the default for that URI protocol. In other cases, the TargetApplicationPackageFamilyName property is optional.

Version history

Windows version SDK version Value added
1607 14393 IgnoreAppUriHandlers
1703 15063 LimitPickerToCurrentAppAndAppUriHandlers

Constructors

LauncherOptions()

Creates and initializes a new instance of the launcher options object.

In a desktop app, before using an instance of this class in a way that displays UI, you'll need to associate the object with its owner's window handle. For more info, and code examples, see Display WinRT UI objects that depend on CoreWindow.

Properties

ContentType

Gets or sets the content type that is associated with a URI that represents a file on the network.

DesiredRemainingView

Launch a target app and have the currently running source app remain on the screen by sharing the space equally with the target app or by taking up more or less space than the target app.

DisplayApplicationPicker

Gets or sets a value that indicates whether to display the Open With dialog whenever the association launching API is called.

FallbackUri

Gets or sets a value that represents a URI that the user should be taken to in the browser if no app exists to handle the file type or URI.

IgnoreAppUriHandlers

Indicates whether to ignore handlers that can handle http(s) schemes (such as browsers). Instead, launch will fall back to the default browser.

LimitPickerToCurrentAppAndAppUriHandlers

Gets or sets whether to limit the picker for the launcher to the current app and its associated URI handlers.

NeighboringFilesQuery

Enables an app to access files that are related to the file used to activate the app.

PreferredApplicationDisplayName

Gets or sets a value that represents the display name of the app in the store that the user should install if no app exists to handle the file type or URI.

PreferredApplicationPackageFamilyName

Gets or sets a value that represents the package family name of the app in the Store that the user should install if no app exists to handle the file type or URI.

TargetApplicationPackageFamilyName

The package family name of the target package that should be used to launch a file or URI. This property is optional in some cases. See Remarks.

TreatAsUntrusted

Gets or sets a value that indicates whether the system should display a warning that the file or URI is potentially unsafe when starting the app associated with a file or URI.

UI

Gets the user interface (UI) options when starting a default app.

Applies to

See also