 |
 |
Power Management ..msdn Add comment |
 |
|
GetPwrCapabilities
|
|
The GetPwrCapabilities function retrieves information about the system power capabilities. |
|
 |
 |
 |
|
GetSystemPowerStatus
|
|
Retrieves the power status of the system. The status indicates whether the system is running on AC or DC power, whether the battery is currently charging, and how much battery life remains. |
|
 |
 |
 |
|
IsPwrSuspendAllowed
|
|
Determines whether the computer supports the sleep states. |
|
 |
 |
 |
|
SetSuspendState
|
|
The SetSuspendState function suspends the system by shutting power down. Depending on the Hibernate parameter, the system either enters a suspend (sleep) state or hibernation (S4). |
|
 |
 |
 |
|
SetSystemPowerState
|
|
The SetSystemPowerState function suspends the system by shutting power down. Depending on the ForceFlag parameter, the function either suspends operation immediately or requests permission from all applications and device drivers before doing so. |
|
 |
 |
 |
|
SetThreadExecutionState
|
|
Enables applications to inform the system that it is in use, thereby preventing the system from entering the sleeping power state or turning off the display while the application is running. |
|
 |
 |
 |
 |
| Code examples: |
 |
|
|
 |
|
 |
 |
User Contributed Notes: |
 |
 |
 |
 |
 |
 | Ricardo Pacheco | 2006-01-12 15:09:33 |  |
 |
 |
 | Not found all Power Management Functions
http://windowssdk.msdn.microsoft.com/library/default.asp?url=/library/en-us/power/base/power_management_functions.asp |  |
 |
 |
 |
 | A.M. | 2006-01-12 16:17:29 |  |
 |
 |
 | Hi Ricardo,
There are several thousand API calls, from which I have about 1000 described on this web site. Of course there may be some functions missed :)
I may assure you, I'm working on it. My point, every function must have a usage sample. |  |
 |
 |
 |
 | Don Higgins | 2006-04-11 13:03:17 |  |
 |
 |
 | How then do you disable any power saving features including turning off hard disks, monitors, standby and hibernate?
I have a tough time with customers who let their systems do this and it shuts down my program. |  |
 |
 |
 |
 | A.M. | 2006-04-11 13:37:13 |  |
 |
 |
 | Most likely it can be done through modifying Power Schemes: functions Get/SetActivePwrScheme, WritePwrScheme.
I have not looked into those yet. Can make a good subject.
The Power Schemes are stored somewhere in the Registry and probably can be accessed directly. |  |
 |
 |
 |
 | Carlos Alloatti | 2006-04-15 12:45:28 |  |
 |
 |
 | Don, Check this:
Intercept power broadcast messages http://blogs.msdn.com/calvin_hsia/archive/2005/01/24/359713.aspx |  |
 |
 |
 |
 |
 |
|