Delphi-PRAXiS
Seite 1 von 2  1 2      

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Win32/Win64 API (native code) (https://www.delphipraxis.net/17-win32-win64-api-native-code/)
-   -   Win 10 Notification wird als Balloon angezeigt, aber nicht im Notification Center (https://www.delphipraxis.net/197041-win-10-notification-wird-als-balloon-angezeigt-aber-nicht-im-notification-center.html)

Kirchi 13. Jul 2018 10:24

Win 10 Notification wird als Balloon angezeigt, aber nicht im Notification Center
 
Liste der Anhänge anzeigen (Anzahl: 1)
Hallo,

ich teste gerade unter Win 10 die Benachrichtigung mit dem Notification Center. Ich hab eine Nachricht erstellt, aber diese wird nur kurz als Ballon angezeigt, bleibt aber nicht im NotificationCenter bestehen. Auch beim Beispiel Code von Embarcadero ist das so.

Code:
procedure TNotificationsForm.btnShowClick(Sender: TObject);
var
  MyNotification: TNotification;
begin
  MyNotification := NotificationCenter1.CreateNotification;
  try
    MyNotification.Name := 'Windows10Notification';
    MyNotification.Title := 'Windows 10 Notification #1';
    MyNotification.AlertBody := 'RAD Studio 10 Seattle';

    NotificationCenter1.PresentNotification(MyNotification);
  finally
    MyNotification.Free;
  end;
end;

Wie kann ich es realisieren, dass meine Benachrichtigung wie z.B. das angehängte Java Update im Notification Center angezeigt wird.

Der schöne Günther 13. Jul 2018 10:47

AW: Win 10 Notification wird als Balloon angezeigt, aber nicht im Notification Center
 
https://stackoverflow.com/q/49094191/2298252

Mavarik 13. Jul 2018 12:17

AW: Win 10 Notification wird als Balloon angezeigt, aber nicht im Notification Center
 
Zitat:

Zitat von Der schöne Günther (Beitrag 1407153)

Hatte das vor 14 Tage auch getestet bei mir funktioniert es nicht - Nach Rücksprache mit Marco Cantu wird daran noch gearbeitet...

z.B. Skype schafft es auch ohne einen Registry Eintrag!

Der schöne Günther 13. Jul 2018 12:43

AW: Win 10 Notification wird als Balloon angezeigt, aber nicht im Notification Center
 
Was erwartest du denn genau? Ja, es der Eintrag bleibt drin stehen. Das funktioniert bei mir auch mit Windows-Stand 1803 noch.


Dass so eine ausgegraute Leiche die nichts macht wenn man draufklickt nicht unbedingt state-of-the-art ist sollte aber auch klar sein. Oder taucht der Eintrag bei dir überhaupt nicht auf?


Anwendungen wie Skype werden wohl als .appx-Paket und nicht mehr einzeln rumschlabbernde .exe ausgeliefert, die können natürlich direkt einiges mehr.

Kirchi 14. Jul 2018 09:54

AW: Win 10 Notification wird als Balloon angezeigt, aber nicht im Notification Center
 
Der Eintrag sollte als Erinnerung für Aufgabe in einer meiner Anwendungen in diesem Benachrichtigungsbereich stehen bleiben. So wie es jetzt aussieht wird nur das Balloon Fenster angezeigt, aber dieser Benachrichtigungsbereich bleibt unberührt.

In dem genannten Registry Eintrag (siehe Link) stehen aber die Anwendungen nicht drin, die bei mir in diesem Benachrichtigungsbereich angezeigt werden wie z.B. Java / Hardcopy / F-Secure. Und wenn man drauf klickt poppen auch die Anwendungen auf, obwohl diese keine .appx Pakete sind.

Also muss das irgendwie doch funktionieren.

Der schöne Günther 14. Jul 2018 11:37

AW: Win 10 Notification wird als Balloon angezeigt, aber nicht im Notification Center
 
Diese Anwendungen laufen aber auch doch bereits (wahrscheinlich dauerhaft) wenn du draufklickst, oder?


Stimmt, ich meine das war früher noch anders:
Zitat:

You must implement a handler for toast activation, so that when the user clicks on your toast, your app can do something. This is required for your toast to persist in Action Center (since the toast could be clicked days later when your app is closed). This class can be placed anywhere in your project.
https://docs.microsoft.com/en-us/win...-the-activator

Dann hat sich bei Delphi wohl wirklich keiner die Mühe gemacht...

Mavarik 16. Jul 2018 14:12

AW: Win 10 Notification wird als Balloon angezeigt, aber nicht im Notification Center
 
Zitat:

Zitat von Der schöne Günther (Beitrag 1407182)
Was erwartest du denn genau? Ja, es der Eintrag bleibt drin stehen. Das funktioniert bei mir auch mit Windows-Stand 1803 noch.

Bei mir nicht - ist sofort wieder weg!

Der schöne Günther 16. Jul 2018 16:10

AW: Win 10 Notification wird als Balloon angezeigt, aber nicht im Notification Center
 
Welche Windows-Version (was spuckt Befehl "winver" aus)?

Ganz, ganz sicher dass der Registry-Eintrag stimmt?

Mavarik 16. Jul 2018 16:59

AW: Win 10 Notification wird als Balloon angezeigt, aber nicht im Notification Center
 
Zitat:

Zitat von Der schöne Günther (Beitrag 1407429)
Welche Windows-Version (was spuckt Befehl "winver" aus)?

Ganz, ganz sicher dass der Registry-Eintrag stimmt?

Version 1803 (Build 17134.165)…

Eigentlich schon...

Hatte mit Marco gesprochen, bei Ihm klappt es auch nicht...

Hast Du ein working-Demo?

Mavarik

Fritzew 16. Jul 2018 17:16

AW: Win 10 Notification wird als Balloon angezeigt, aber nicht im Notification Center
 
Habe gerade mal nachgeschaut:

Ich mache das so für eine Anwendung und funktioniert

Delphi-Quellcode:
procedure TAppForm.checkToastActionCenterKey(const StayInCenter: Integer);

const
   cKeyname = 'Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\';
   cActionKey = 'ShowInActionCenter';
var
   Reg: TRegistry;
   OpenResult: Boolean;
   lKey: string;
begin
   lKey := cKeyname + getRegisterToastMessage + '\';
   Reg := TRegistry.Create(KEY_WRITE);
   try
      Reg.RootKey := HKEY_CURRENT_USER;
      OpenResult := Reg.OpenKey(lKey, true);

      if not OpenResult then
         Exit();

    { Checking if the values exist and inserting when neccesary }

      if not Reg.KeyExists(cActionKey) then
         Reg.WriteInteger(cActionKey, StayInCenter); // else

      Reg.CloseKey();
   finally
      Reg.Free;
   end;

end;

function TAppForm.getRegisterToastMessage: string;
const
   AppId = 'Embarcadero.DesktopToasts.';
begin
   result := AppId + THashBobJenkinsGetHashString(ParamStr(0));
end;

procedure TAppForm.SendToastMessage(const Value: string);
var
   MyNotification: TNotification;
begin
   MyNotification := fNotification.CreateNotification;
   try
      MyNotification.Name := 'Fritz';
      MyNotification.Title := 'MyTost';
      MyNotification.AlertBody := Value;
      MyNotification.AlertAction := '';;
      MyNotification.HasAction := true;

      fNotification.PresentNotification(MyNotification);
   finally
      MyNotification.Free;
   end;
end;

procedure TAppForm.FormCreate(Sender: TObject);
begin
   fNotification := TNotificationCenter.Create(self);
   checkToastActionCenterKey(1);
end;
Habe aber System.Notifactions als Source im Projekt


Alle Zeitangaben in WEZ +1. Es ist jetzt 04:12 Uhr.
Seite 1 von 2  1 2      

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz