ActivationRegistrationManager.RegisterForFileTypeActivation Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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 exectuable 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
UnregisterForFileTypeActivation
Applies to
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for