pywin32 : scheduled weakup from standby/hiberate ?

R

robert

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
 
J

Jesse Hager

robert said:
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.
 
R

Roger Upole

.."robert said:
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

Pywin32 has a taskscheduler module that can be used
to create a scheduled task to wake up your system.
The TASK_FLAG_SYSTEM_REQUIRED flag
corresponds to the "Wake the system to run this task"
option in the UI.

hth
Roger
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,294
Messages
2,571,508
Members
48,193
Latest member
DannyRober

Latest Threads

Top