0

I set a waitable timer to wake Windows at a predefined time as such:

if(SetWaitableTimer(hTimer, &liWhen, 0, NULL, NULL, TRUE))
{
    if(GetLastError() == ERROR_NOT_SUPPORTED)
    {
        //Waking is not supported
    }
}

I run this code on a Windows 8 Pro tablet from a native desktop app and I get ERROR_NOT_SUPPORTED. If I ignore it, the tablet doesn't wake up at the time I specify. If I run the same code from a Windows 7 desktop, it wakes up every time.

Note that Windows Task Scheduler on that same Windows 8 tablet has "Wake the computer to run this task" option grayed out as well, but a native Windows 8 Metro calendar app seems to work & wakes this tablet from sleep without any issues.

Did Microsoft change something in the way desktop apps behave on Windows 8? Or did they introduce new APIs to manager power states?

EDIT Found this "gem" from Microsoft about Desktop Activity Moderator. It obviously suspends all desktop apps that don't run as services while Windows 8 is in the new "connected standby" mode. What it fails to answer is how to set a timer to get out of that mode. Metro apps can do it, but what about desktop apps?

c00000fd
  • 20,994
  • 29
  • 177
  • 400
  • Have you enabled it in Control Panel? Go to `All Control Panel Items\Power Options\Edit Plan Settings` then click `Change Advanced Power Setting` and expand `Sleep` in the tree to enable `Allow Wake Timers`. – Roger Rowland May 31 '13 at 09:36
  • @RogerRowland: Tried that. There are no timers in adv. power options. Moreover doing `powercfg/waketimers` in cmd returns 0 timers. At the same time a tablet can wake up from a Metro calendar app. – c00000fd Jun 01 '13 at 16:44

0 Answers0