Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Power API
I am building an Excel alarm clock for a laptop. I am updating the display
with an OnTime event. One of the requirements is to autonomously detect if the laptop switches from A/C power to its internal battery. Has anyone come across an API that will return the power state? Say TRUE if A/C, FALSE if battery? Thanks for any leads. -- Gary''s Student - gsnu200766 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Power API
Maybe...
Private Declare Function GetDevicePowerState Lib "kernel32.dll" _ (ByVal hDevice As Long, ByRef pfOn As Long) As Long http://msdn2.microsoft.com/en-us/library/aa372690.aspx Private Declare Function GetSystemPowerStatus Lib "kernel32.dll" _ (ByRef lpSystemPowerStatus As SYSTEM_POWER_STATUS) As Long http://msdn2.microsoft.com/en-us/lib...93(VS.85).aspx -- Jim Cone San Francisco, USA http://www.realezsites.com/bus/primitivesoftware (Excel Add-ins / Excel Programming) "Gary''s Student" wrote in message I am building an Excel alarm clock for a laptop. I am updating the display with an OnTime event. One of the requirements is to autonomously detect if the laptop switches from A/C power to its internal battery. Has anyone come across an API that will return the power state? Say TRUE if A/C, FALSE if battery? Thanks for any leads. -- Gary''s Student - gsnu200766 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Power API
Actually this looks to be the link and it contains some more info, about 2/3
the way down. http://www.codeguru.com/forum/archiv.../t-199354.html -- -John Please rate when your question is answered to help us and others know what is helpful. "Gary''s Student" wrote: I am building an Excel alarm clock for a laptop. I am updating the display with an OnTime event. One of the requirements is to autonomously detect if the laptop switches from A/C power to its internal battery. Has anyone come across an API that will return the power state? Say TRUE if A/C, FALSE if battery? Thanks for any leads. -- Gary''s Student - gsnu200766 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Power API
Thank Jim (once again) !
-- Gary''s Student - gsnu200766 "Jim Cone" wrote: Maybe... Private Declare Function GetDevicePowerState Lib "kernel32.dll" _ (ByVal hDevice As Long, ByRef pfOn As Long) As Long http://msdn2.microsoft.com/en-us/library/aa372690.aspx Private Declare Function GetSystemPowerStatus Lib "kernel32.dll" _ (ByRef lpSystemPowerStatus As SYSTEM_POWER_STATUS) As Long http://msdn2.microsoft.com/en-us/lib...93(VS.85).aspx -- Jim Cone San Francisco, USA http://www.realezsites.com/bus/primitivesoftware (Excel Add-ins / Excel Programming) "Gary''s Student" wrote in message I am building an Excel alarm clock for a laptop. I am updating the display with an OnTime event. One of the requirements is to autonomously detect if the laptop switches from A/C power to its internal battery. Has anyone come across an API that will return the power state? Say TRUE if A/C, FALSE if battery? Thanks for any leads. -- Gary''s Student - gsnu200766 |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Power API
Thanks John!!
-- Gary''s Student - gsnu200766 "John Bundy" wrote: Actually this looks to be the link and it contains some more info, about 2/3 the way down. http://www.codeguru.com/forum/archiv.../t-199354.html -- -John Please rate when your question is answered to help us and others know what is helpful. "Gary''s Student" wrote: I am building an Excel alarm clock for a laptop. I am updating the display with an OnTime event. One of the requirements is to autonomously detect if the laptop switches from A/C power to its internal battery. Has anyone come across an API that will return the power state? Say TRUE if A/C, FALSE if battery? Thanks for any leads. -- Gary''s Student - gsnu200766 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Ten to the power of six | New Users to Excel | |||
Power and Sum | Excel Worksheet Functions | |||
Nth power dilemma | Excel Discussion (Misc queries) | |||
shortcut for x^2 (power) | Excel Discussion (Misc queries) | |||
how to use power point | Excel Discussion (Misc queries) |