在 Windows 8 应用程序中调整屏幕亮度 [英] Adjust the screen brightness in a Windows 8 App

查看:39
本文介绍了在 Windows 8 应用程序中调整屏幕亮度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发 Windows 8 应用程序.有没有办法访问设备的亮度设置,以便用户可以从应用程序内部调整设备的亮度?谢谢

I am developing a Windows 8 application. Is there a way I can access the device's brightness settings so the user can adjust the brightness of the device from inside the app? Thanks

推荐答案

我正在使用批处理文件来更改内容,但看起来 Windows 也提供了一个 API,您可以直接从 C#(以及 p/Invoke 然后调用)作为好吧...所以以上所有内容仍然正确并且仍然有效,但您也可以调用

I was using a batch file to change things but it also looks like Windows provided an API you can directly from C# (well p/Invoke and then call) as well... so all the above is still true and will still work, but you can also call

PowerGetActiveScheme

PowerWriteACValueIndex

PowerWriteDCValueIndex

那些链接也很好,因为它们为您列出了所有子 guid.因此,只需 P/Invoke 那些坏孩子并直接从您的应用中调用它们,无需批处理文件 :)

Those links are nice too, because they have all the Sub guids listed out for you. So just P/Invoke those bad boys and call them directly from your app, no batch file needed :)

这篇关于在 Windows 8 应用程序中调整屏幕亮度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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