INotificationActivationCallback::Activate method (notificationactivationcallback.h)

Called when a user interacts with a toast in the action center.

Syntax

HRESULT Activate(
  [in] LPCWSTR                            appUserModelId,
  [in] LPCWSTR                            invokedArgs,
  [in] const NOTIFICATION_USER_INPUT_DATA *data,
  [in] ULONG                              count
);

Parameters

[in] appUserModelId

The unique identifier representing your app to the notification platform.

[in] invokedArgs

Arguments from the invoked button. NULL if the toast indicates the default activation and no launch arguments were specified in the XML payload.

[in] data

The data from the input elements available on the notification toast.

[in] count

The number of data elements.

Return value

If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Remarks

In order for your app to respond to toasts in the action center, you need to override this method in your app. You also will need to create a shortcut on the start menu. For more information about how to respond to activation notifications, see Respond to toast activations.

If your application uses non-interactive toasts, you can respond to those without using invokedArgs or data.

If you return a failure code, the activation will fail and the user can try again to activate your app.

Requirements

Requirement Value
Minimum supported client Windows 10 [desktop apps only]
Minimum supported server None supported
Target Platform Windows
Header notificationactivationcallback.h

See also

INotificationActivationCallback

Respond to toast activations