Ir al contenido


Foto

Deshabilitar sonido de notificaciones


  • Por favor identifícate para responder
No hay respuestas en este tema

#1 Punzo

Punzo

    Member

  • Miembros
  • PipPip
  • 24 mensajes

Escrito 22 octubre 2020 - 12:19

Buen día a todos, quiero deshabilitar el sonido de las notificaciones con la propiedad EnableSound, y simplemente no lo hace, estoy pasando algo por alto?, gracias de antemano


delphi
  1. procedure TMesa.OnTm1(Sender :TObject);
  2. var
  3. N, Hm :TTime;
  4. D :TDateTime;
  5. Dif :Integer;
  6. Notificacion: TNotification;
  7. Notc :TNotificationCenter;
  8. begin
  9. Notc := TNotificationCenter.Create(Self);
  10. Notificacion := Notc.CreateNotification ;
  11. Notificacion.Name := Numero;
  12. Notificacion.EnableSound := False;
  13. if HoraM = '' then
  14. HoraM := Hora;
  15. Hm := StrToTime(LeftStr(HoraM, 2) + ':' + MidStr(HoraM, 3, 2) + ':' + RightStr(HoraM, 2));
  16. N := StrToTime(FormatDateTime('hh:nn:ss', Now));
  17. if Hm > N then
  18. D := Hm - N
  19. else
  20. D := N - Hm;
  21. Dif := StrToInt(FormatDateTime('nn', D));
  22. if (Dif >= 10) and (Dif < 15) then
  23. begin
  24. TintColor := TAlphaColorRec.Yellow;
  25. Notificacion.EnableSound := False;
  26. Notificacion.AlertBody := 'La mesa ' + Trim(Numero) + ' tiene más de 10 minutos sin movimiento';
  27. Notc.PresentNotification(Notificacion);
  28. Inc(Notificacion.Number);
  29. end
  30. else if Dif >= 15 then
  31. begin
  32. TintColor := TAlphaColorRec.Red;
  33. Notificacion.EnableSound := False;
  34. Notificacion.AlertBody := 'La mesa ' + Trim(Numero) + ' tiene más de 15 minutos sin movimiento';
  35. Notc.PresentNotification(Notificacion);
  36. Inc(Notificacion.Number);
  37. end;
  38. Notificacion.DisposeOf;
  39. Notc.DisposeOf;


  • 0




IP.Board spam blocked by CleanTalk.