Im Win32 C programmer and I need to use WakeupOnStandBy code to write a program that wakes up my computer. How can I do it without MFC classes?
We used MFC to write WakeupOnStandBy to simplify the source code of all the GUI controls it has, but you can also do the same under Win32. Search the project for the use of the following API’s: CreateWaitableTimer, SetWaitableTimer, WaitForSingleObject, ShellExecute, SetSuspendState. These are the core functions that will also work under Win32 with minor changes. Here’s how the whole concept works: • Create waitable timer when your app starts up like this:hTimer = CreateWaitableTimer(NULL, TRUE, NULL); //[more info] • Then set waitable timer to the time to wake up your PC: (NOTE: The timer time units are measured in 100 nanosecond intervals, that is a second times 10 raised to the power of minus seven.)//’st’ is of SYSTEMTIME type, contains date & time to wake-up from Stand-by FILETIME ft; if(SystemTimeToFileTime(&st, &ft)) //[more info] { //Set large integer used by SetWaitableTimer //(Will use absolute time in 100 nanosecond intervals) LARGE_INTEGER li; //[more info] li.LowPart = ft.
Related Questions
- Im Win32 C programmer and I need to use WakeupOnStandBy code to write a program that wakes up my computer. How can I do it without MFC classes?
- Can you use a calculator when taking the job knowladge test? Is there spelling check on the computer program when you write the essay test?
- I want to write a computer program that plays Othello. Are there any academic papers written about computer Othello?