码迷,mamicode.com
首页 > Windows程序 > 详细

delphi xe10 消息操作

时间:2019-07-05 12:38:44      阅读:163      评论:0      收藏:0      [点我收藏+]

标签:操作   发送   mobile   class   The   form   tns   pre   not   

//消息提醒(从手机屏幕顶部向下滑动,出现的提示消息)
NotificationC: TNotificationCenter; 
procedure TNotificationsForm.btnSendNotificationImmediatelyClick(
  Sender: TObject);
var
  Notification: TNotification;
begin
  { verify if the service is actually supported }
  if NotificationC.Supported then
  begin
    Notification := NotificationC.CreateNotification;
    try
      Notification.Name := MyNotification;
      Notification.AlertBody := Delphi for Mobile is here!;
      Notification.FireDate := Now; //可修改发送消息时间
      { Send notification in Notification Center }
      NotificationC.ScheduleNotification(Notification);
      { also this method is equivalent }
      // NotificationService.PresentNotification(Notification);
    finally
      Notification.DisposeOf;
    end;
  end
end;
  if NotificationC.Supported then
    NotificationC.CancelNotification(MyNotification); //取消消息
    NotificationC.CancelAll; //取消所有消息

 

delphi xe10 消息操作

标签:操作   发送   mobile   class   The   form   tns   pre   not   

原文地址:https://www.cnblogs.com/guorongtao/p/11137373.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!