I am using Delphi 10.2 on Windows 10. The following code is an example of the code provided by Embarcadero.
After running this code, the notification disappears and does not stop in the Action Center. How can I let this linger there?
procedure TNotify.btnShowClick(Sender: TObject);
var
MyNotification: TNotification;
begin
MyNotification := NotificationCenter1.CreateNotification;
try
MyNotification.Name := 'Windows10Notification';
MyNotification.Title := 'Windows 10 Notification
MyNotification.AlertBody := 'RAD Studio 10 Seattle';
NotificationCenter1.PresentNotification(MyNotification);
finally
MyNotification.Free;
end;
end;
ADDED: after turning on the Windows settings switch> System> Notifications and actions, I see HKEY_CURRENT_USER \ Software \ Microsoft \ Windows \ CurrentVersion \ Notifications \ Settings \ Embarcadero.DesktopToasts.0579D43 \ AShowInActionCenter = 1. But every user who will use this application is not can do this all the time manually, and I also cannot predict the key name.