使用Win32 API监视电池电量 [英] Monitor battery charge with Win32 API

查看:577
本文介绍了使用Win32 API监视电池电量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想写一个小应用程序,监视笔记本电池中剩余的电量,我想知道我可以使用哪个Win32函数来完成。

I'm trying to write a small app that monitors how much power is left in a notebook battery and I'd like to know which Win32 function I could use to accomplish that.

推荐答案

对于Vista及以上版本,您可以使用 RegisterPowerSettingNotification

For Vista and up you can use RegisterPowerSettingNotification

对于早期功能,请参阅电源管理功能在MSDN页面电源管理功能:Windows Server 2003及更早版本中的此部分

For earlier functions see the Power Management Functions in this section of the MSDN page "Power Management Functions: Windows Server 2003 and Earlier"

可以在代码项中查看Vista方法的示例代码。

You can see example code of the Vista method on codeproject.

这篇关于使用Win32 API监视电池电量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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