Sorry, you are (partly) right, I was forgotten about On-Now capable boxes
(if not tuned off in the BIOS!).
But the System:Threadin g::Timer wraps the Waitable timer API's. This class
methods do call the internal CLR function 'InternalAddTim er' which calls the
CreateWaitableT imer and SetWaitableTime r Kernel32 API's.
So if you run something like this:
Timer* myWakeUpTimer =
new Timer(wakeUpDel egate, 0, 120000, -1);
Console::ReadLi ne();
And suspend the system, it will resume after the interval (60 sec.)
Willy.
"Ben Voigt" <bv****@nospam. nospam> wrote in message
news:%2******** ********@TK2MSF TNGP14.phx.gbl. ..
|
| "Willy Denoyette [MVP]" wrote in message
| news:%2******** *******@TK2MSFT NGP12.phx.gbl.. .
| >
| > "Lonewolf" <an*******@mozi lla.org> wrote in message
| > news:%2******** *******@TK2MSFT NGP12.phx.gbl.. .
| > | Lonewolf wrote:
| > | > Hi all,
| > | > I am not sure if it is even possible to do it from .NET itself.
Is
| > | > there something like a waitable timer which can resume the system
from
| > | > its hibernate or standby (S3: suspend to ram) mode. I'm trying to
use
| > C#
| > | > to create something that can "wake" the system up at a particular
time
| > | > (set by user) if it is in hibernate or standby mode to do certain
task
| > | > and after which to put it back to sleep again. Is it possible? I'm
| > using
| > | > VS2005. Please enlighten me on this. thank you for your time and
| > | > patience. :)
| > | >
| > | > I know of the power mgmt mode in .NET which can put the system to
| > sleep,
| > | > but how to use waitable timer to wake it up?
| > |
| > | *ding dong* no one has even tried it before?
| >
| >
| > The win32 waitable timers are all wrapped by the System.Timers,
| > System.Threadin g.Timers namespace classes. But these wont help you
anyway,
|
| not according to:
|
http://msdn.microsoft.com/library/en..._up_events.asp
|
| > because a system that is in S3 or hibernated state does not run any
code,
| > so
| > your timer would not fire anyway. A standby or hibernated system can
only
| > be
| > resumed by an external event like a keyboard, mouse, network event or
| > other
| > HW (programmable timer) supplied event.
|
| And waitable timer is the Win32 API for setting up hardware timers. Not
| seeing any .NET calls for it.
|
| >
| > Willy.
| >
| >
| >
|
|