Condividi tramite


Auto-launching with file and URI associations (XAML)

You can use the Windows.System.Launcher API to launch the user's default app for a file type or protocol. You can also enable your app to be the default app for a file type or protocol.

In this section

Topic Description

How to handle file activation

An app can register to become the default handler for a certain file type. Both desktop apps and Windows Runtime apps can register to be a default file handler. If the user chooses your app as the default handler for a certain file type, your app will be activated every time that type of file is launched.

How to handle URI activation

An app can register to become the default handler for a certain Uniform Resource Identifier (URI) scheme name. Both desktop apps and Windows Runtime apps can register to be a default handler for a URI scheme name. If the user chooses your app as the default handler for a URI scheme name, your app will be activated every time that type of URI is launched.

How to launch the default app for a file

Learn how to launch the default app for a file. Many apps need to work with files that they can't handle themselves. For example, e-mail apps receive a variety of file types and need a way to launch these files in their default handlers. These steps show how to use the Windows.System.Launcher API to launch the default handler for a file that your app can't handle itself.

How to launch the default app for a URI

Learn how to launch the default app for a URI. URIs allow you to launch another app on the operating system to perform a specific task. For example, if you want to allow the user to send a mail to a contact in your app, you can use the mailto: URI to launch the user’s default e-mail app.

How to launch the Settings app (XAML)

Launch the built-in Settings app by using the ms-settings URI scheme described in this topic.

 

Guidelines

Guidelines for file types and URIs

Reference

Windows.System.Launcher