[W8.1]在Windows 8.1中检查应用程序背景或前景 [英] [W8.1]Check app background or foreground in Windows 8.1

查看:59
本文介绍了[W8.1]在Windows 8.1中检查应用程序背景或前景的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何检查应用程序是在前台还是后台Windows 8.1?如何在应用程序未运行时显示Toast通知?

推荐答案

您好,在Windows中查找设备系列,

Hi Finding device family in windows,

>>如何在Windows 8.1中检查应用是在前台还是后台?

>>How to check whether the app is in foreground or background in windows 8.1 ?

应用程序在前景或背景中的含义是什么?
在任何给定时间点,应用程序都没有运行,运行或暂停。当用户切换应用程序或Windows进入低功耗状态时,应用程序可以暂停。当您的应用暂停时,它会继续驻留在内存中,以便用户可以快速可靠地在已暂停的应用之间切换,然后重新启动它们。 同时,有多种方式可以让应用程序在后台运行时需要继续运行
,例如
  后台
任务

What does the mean that the app in foreground or background? At any given point, an app is not running, running, or suspended. An app can be suspended when the user switches away from it or when Windows enters a low power state. While your app is suspended, it continues to reside in memory so that users can quickly and reliably switch between suspended apps, resuming them. Meanwhile there are various ways for apps that need to continue to run when they are in the background such as background tasks.

>>如何在应用程序未运行时显示Toast通知?

>>how to display toast notification when application is not running ?

你可以注册

后台任务
,以及在应用程序未运行时显示Toast通知所需的触发器。这是一个

通知
示例。它适用于UWP,但它与Windows 8.1类似,您可以参考它。

You can register a background task with the trigger that you needs to display toast notification when the app is not running. Here is a Notifications sample. It is for UWP, but  it is similar with Windows 8.1 and you can refer to it.


这篇关于[W8.1]在Windows 8.1中检查应用程序背景或前景的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆