Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

C#, wake computer from sleep

Name: Anonymous 2011-01-24 12:51

I'm creating a small alarm clock for fun, and I want to wake up the computer from sleep at a certain time.

I found this code, http://www.pcreview.co.uk/forums/showpost.php?p=11849260&postcount=4, and it works.
But.. as soon as I initiate it the program becomes unresponsive until the timer is finished.

What to do?

Name: Anonymous 2011-01-24 13:00

Do you actually understand the code?
There's no explicit "Wake up in X" function there; all the code does is it goes to sleep for a specific time, and I suppose that the P/Invoke calls are guaranteed to work even if the computer goes to sleep while the code sleeps.
Now, if the purpose of the program is to wake up your PC after a certain time, what the fuck would you want to do in the meantime?
Just spawn a background thread for the sleeping and it should work.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List