Win10 uwp screen always on

Source: Internet
Author: User

Win10 uwp screen always on

We need to keep the screen bright when playing a video. We can use DisplayRequest because the code is simple and I will write it directly.

Recently, I am not promising to break UWP with others. I have seen many other countries, but I still don't know about it in China. But now I am going to use linux C ++. UWP will not give up in a year or two.

If we do this, the screen will not be turned off. If we put it, it will first become grayed out, and then it will become dark. If we need to play a video, we will not press the screen, the screen must always be on.

The following code can be used on our play screen so that the screen will not be turned off, but the screen will not be normally played by an application. If there is anything else to turn off the screen, the screen will not always turn on.

Now we can see that the screen is always on UWP. I have to wait for a long time for the app to be transferred to the background. I don't know if my pc can make the app go on the background mobile phone.

Public event Action on_paly; private DisplayRequest displayRequest; protected override void OnNavigatedFrom (NavigationEventArgs e) {base. onNavigatedFrom (e); displayRequest = new DisplayRequest (); displayRequest. requestRelease (); on_paly + = () => {displayRequest. requestActive ();};}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.