简体   繁体   中英

Windows sleep even for UWP apps

In my app I have UP and DOWN channels which continuously listen for Audio stream. I want to know that In windows is there any event which will tell me that machine is now going to sleep state (not sign-out because machine will go to sleep after sign-out based on the user settings) so that i can suspend the channels and once machine wake-up(Not sign-in because machine wake up before the sign-in even) then i can resume it again.

Something similar to Cortana 在此输入图像描述

Thanks in advance.

There's no 'sleep' relevant APIs for you to detect if the windows will go to sleep in UWP.

If you check the Windows 10 universal Windows platform (UWP) app lifecycle , you will find that Suspending and Resuming are the right events to listen to.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM