Langage

ActivationRegistrationManager.RegisterForFileTypeActivation Méthode

Définition

S’inscrit pour activer l’application lorsque le type de fichier spécifié est ouvert via ShellExecute, Launcher.LaunchFileAsync ou la ligne de commande.

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)

Paramètres

supportedFileTypes

String[]

Platform::String[]

winrt::hstring[]

Un ou plusieurs types de fichiers pris en charge, spécifiés par l’extension de fichier, y compris le début ., tel que .docx.

logo
String

Platform::String

winrt::hstring

Chemin d’accès à l’image ou à la ressource utilisée par Windows pour le type de fichier. Pour les applications empaquetées, ce paramètre est un chemin relatif au package d’un fichier image. Pour un package non empaqueté, ce paramètre est un chemin de fichier littéral vers un fichier binaire (DLL, EXE) ainsi qu’un index de ressource.

displayName
String

Platform::String

winrt::hstring

Ce nom d’affichage utilisé par Windows pour le type de fichier.

supportedVerbs

String[]

Platform::String[]

winrt::hstring[]

Zéro ou plusieurs verbes définis par l’application. Chaque verbe est ajouté au menu contextuel de l’Explorateur de fichiers lorsqu’un fichier inscrit est cliqué avec le bouton droit et que le verbe sélectionné est transmis à l’application en tant que propriété IFileActivatedEventArgs.Verb .

exePath
String

Platform::String

winrt::hstring

Chemin d’accès à l’exécutable à activer. Si vous passez une chaîne vide, l’exécutable actuel est activé par défaut. En règle générale, ce paramètre est spécifié si l’appelant de cette méthode est le programme d’installation de l’application plutôt que l’application elle-même.

Attributs

Remarques

Les applications empaquetées doivent continuer à utiliser leur manifeste appx pour s’inscrire au type de fichier, au protocole ou à l’activation de démarrage. Ils peuvent ensuite utiliser Microsoft.Windows. AppLifecycle.AppInstance.GetActivatedEventArgs ou Windows. ApplicationModel.AppInstance.GetActivatedEventArgs pour récupérer les arguments lors de l’activation.

S’applique à

Voir aussi