怎么调用API函数进行windows电源管理

如何调用API函数进行windows电源管理
一个电源管理小程序,当电量在95%以上时即使插着电源也不充电,在95%以下进行充电。这该如何实现,需要调用哪些API函数?

------解决方案--------------------
Power Management Functions
The following functions are used with power management.

Function Description
GetDevicePowerState Retrieves the current power state of the specified device.
GetSystemPowerStatus Retrieves the power status of the system.
IsSystemResumeAutomatic Indicates the current state of the computer.
RequestWakeupLatency Specifies roughly how quickly the computer should enter the working state.
SetSystemPowerState Suspends the system by shutting power down.
SetThreadExecutionState Enables applications to inform
------解决方案--------------------
参考网页:
http://www.diybl.com/course/3_program/vc/vc_js/20100630/268962.html
------解决方案--------------------
充电不是由软件控制的吧。只是在传感器检测到电池容量的时候来做不同的显示而已。
------解决方案--------------------
当然你可以自己这样来设计,先检测电池容量,如果大于95%,控制IO口之类让充电线不通