Share via


ActivationRegistrationManager.RegisterForFileTypeActivation Method

Definition

Registers to activate the app when the specified file type is opened via ShellExecute, Launcher.LaunchFileAsync, or the command-line.

public:
 static void RegisterForFileTypeActivation(Platform::Array <Platform::String ^> ^ supportedFileTypes, Platform::String ^ logo, Platform::String ^ displayName, Platform::Array <Platform::String ^> ^ supportedVerbs, Platform::String ^ exePath);
/// [Windows.Foundation.Metadata.Experimental]
 static void RegisterForFileTypeActivation(winrt::array_view <winrt::hstring const&> const& supportedFileTypes, winrt::hstring const& logo, winrt::hstring const& displayName, winrt::array_view <winrt::hstring const&> const& supportedVerbs, winrt::hstring const& exePath);
 static void RegisterForFileTypeActivation(winrt::array_view <winrt::hstring const&> const& supportedFileTypes, winrt::hstring const& logo, winrt::hstring const& displayName, winrt::array_view <winrt::hstring const&> const& supportedVerbs, winrt::hstring const& exePath);
[Windows.Foundation.Metadata.Experimental]
public static void RegisterForFileTypeActivation(string[] supportedFileTypes, string logo, string displayName, string[] supportedVerbs, string exePath);
public static void RegisterForFileTypeActivation(string[] supportedFileTypes, string logo, string displayName, string[] supportedVerbs, string exePath);
function registerForFileTypeActivation(supportedFileTypes, logo, displayName, supportedVerbs, exePath)
Public Shared Sub RegisterForFileTypeActivation (supportedFileTypes As String(), logo As String, displayName As String, supportedVerbs As String(), exePath As String)

Parameters

supportedFileTypes

String[]

Platform::String[]

winrt::hstring[]

One or more supported file types, specified by the file extension including the leading ., such as .docx.

logo
String

Platform::String

winrt::hstring

The path to the image or resource used by Windows for the file type. For packaged apps, this parameter is a package-relative path to an image file. For unpackaged, this parameter is a literal filepath to a binary file (DLL, EXE) plus a resource index.

displayName
String

Platform::String

winrt::hstring

This display name used by Windows for the file type.

supportedVerbs

String[]

Platform::String[]

winrt::hstring[]

Zero or more app-defined verbs. Each verb is added to the File Explorer context menu when a registered file is right-clicked, and the selected verb is passed to the app as the IFileActivatedEventArgs.Verb property.

exePath
String

Platform::String

winrt::hstring

The path to the executable to be activated. If you pass an empty string, the current executable will be activated by default. Typically this parameter is specified if the caller of this method is the app's installer rather than the app itself.

Attributes

Remarks

Packaged apps should continue to use their appx manifest to register for file-type, protocol or startup activation. They can then use either Microsoft.Windows.AppLifecycle.AppInstance.GetActivatedEventArgs or Windows.ApplicationModel.AppInstance.GetActivatedEventArgs to retrieve the arguments on activation.

Applies to

See also