检查 UWP-Application 是否在前台/焦点 [英] Check if UWP-Application is in Foreground/Focused

查看:32
本文介绍了检查 UWP-Application 是否在前台/焦点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想检查当前应用程序是否在前台/焦点中.该应用程序是一个 windows-10 UWP 应用程序.

我已经得到的是,检查当前应用程序是否最小化.为此,我使用 Window.CurrentVisibilityChanged 事件.

但我没有找到解决方案来检测应用程序是否在前台.

解决方案

我不能 100% 确定,但似乎 Windows.UI.Xaml.Window.Activated 事件应该满足您的需求.>

I want to check if the current application is in the foreground/focused. The application is a windows-10 UWP application.

What i already got is, to check if the current application is minimized. For that i use the VisibilityChanged event of Window.Current.

But i don´t find a solution, to detect if the application is in foreground or not.

解决方案

I can't be 100% sure but it seems that Windows.UI.Xaml.Window.Activated event should suit your needs.

这篇关于检查 UWP-Application 是否在前台/焦点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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