pywin32 : scheduled weakup from standby/hiberate ?

Jesse Hager wrffruntre at tznvy.pbz.ROT13
Tue Apr 18 22:39:20 EDT 2006


robert wrote:
> On Windows the task scheduler tool can program (the BIOS?) to weak up 
> the machine from standby/hibernate at certain pre-configured times. Can 
> this be done directly through the (py)win32 API?
> 
> robert

What you need is a Waitable Timer.

The APIs to manipulate these are:

win32event.CreateWaitableTimer()
win32event.SetWaitableTimer()
win32event.CancelWaitableTimer()

The wakeup feature is enabled when the last parameter of the call to 
SetWaitableTimer is True.

However, pywin32 seems to be missing a binding for the 
SetThreadExecutionState() function so unless a person moves the mouse or 
keyboard within a minute or two of the wakeup, the system just goes back 
to sleep.

You should be able to call the SetThreadExecutionState function using 
ctypes.

Search for Power Management in the MSDN library for info on these functions.

--
Jesse Hager
email = "wrffruntre at tznvy.pbz".decode("rot13")



More information about the Python-list mailing list