ActivationRegistrationManager.RegisterForStartupActivation 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 when the app is started by the user logging into the Windows OS, either because of a registry key, or because of a shortcut in a well-known startup folder.
public:
static void RegisterForStartupActivation(Platform::String ^ taskId, Platform::String ^ exePath);
/// [Windows.Foundation.Metadata.Experimental]
static void RegisterForStartupActivation(winrt::hstring const& taskId, winrt::hstring const& exePath);
static void RegisterForStartupActivation(winrt::hstring const& taskId, winrt::hstring const& exePath);
[Windows.Foundation.Metadata.Experimental]
public static void RegisterForStartupActivation(string taskId, string exePath);
public static void RegisterForStartupActivation(string taskId, string exePath);
function registerForStartupActivation(taskId, exePath)
Public Shared Sub RegisterForStartupActivation (taskId As String, exePath As String)
Parameters
- taskId
-
String
Platform::String
winrt::hstring
An app-defined ID that can be used to unregister for startup activations later by using the UnregisterForStartupActivation method.
- 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
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.