Query regarding WinNT sleep state
-
Hello !! I want to take the system into sleep state aand wake the system after say 10 seconds.. I am using the API SetSystemPowerState(). I have used Setwaitabletimer for 10 seconds to fire an signal after 10 seconds so as to wake the system and come out of sleep state.The system is going into sleep state and then returning from sleep after 10 seconds(indicator lights on the monitor changes but nothing appears on the screen) but nothing on the screen is visible afterwards. Only when I press a key or move the mouse does the monitor gets refreshed. Is there some problem in the permissions set??? Can you please help. I have used the following: OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY,&hToken)); LookupPrivilegeValue(NULL,SE_SHUTDOWN_NAME ,&tkp.Privileges[0].Luid); AdjustTokenPrivileges(hToken,FALSE,&tkp,sizeof(TOKEN_PRIVILEGES), &oldtp&dwSize); Sandeep
-
Hello !! I want to take the system into sleep state aand wake the system after say 10 seconds.. I am using the API SetSystemPowerState(). I have used Setwaitabletimer for 10 seconds to fire an signal after 10 seconds so as to wake the system and come out of sleep state.The system is going into sleep state and then returning from sleep after 10 seconds(indicator lights on the monitor changes but nothing appears on the screen) but nothing on the screen is visible afterwards. Only when I press a key or move the mouse does the monitor gets refreshed. Is there some problem in the permissions set??? Can you please help. I have used the following: OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY,&hToken)); LookupPrivilegeValue(NULL,SE_SHUTDOWN_NAME ,&tkp.Privileges[0].Luid); AdjustTokenPrivileges(hToken,FALSE,&tkp,sizeof(TOKEN_PRIVILEGES), &oldtp&dwSize); Sandeep
Could it be a systems setting? I remeber of something like "Restore desktop after sleep/suspend mode" for NT4 and Win95. (Don't know the exact option, I'm Italian). It should be somewhere in the PowerSavings options. Paolo