Skip to content

Latest commit

 

History

History
42 lines (26 loc) · 2.86 KB

launcheroptions.md

File metadata and controls

42 lines (26 loc) · 2.86 KB
-api-id -api-type
T:Windows.System.LauncherOptions
winrt class

Windows.System.LauncherOptions

-description

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.

-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

-examples

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

-see-also

Association launching sample, Launch the default app for a file, Launch the default app for a URI, Guidelines for file types and URIs, Launcher.LaunchFileAsync(IStorageFile, LauncherOptions), Launcher.LaunchUriAsync(Uri, LauncherOptions)