AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein Win32/Win64 API (native code) Win 10 Notification wird als Balloon angezeigt, aber nicht im Notification Center
Thema durchsuchen
Ansicht
Themen-Optionen

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

Ein Thema von Kirchi · begonnen am 13. Jul 2018 · letzter Beitrag vom 17. Jul 2018
 
Fritzew

Registriert seit: 18. Nov 2015
Ort: Kehl
678 Beiträge
 
Delphi 11 Alexandria
 
#10

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

  Alt 16. Jul 2018, 17:16
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
Fritz Westermann

Geändert von Fritzew (16. Jul 2018 um 17:23 Uhr)
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 23:29 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz