Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Query regarding WinNT sleep state

Query regarding WinNT sleep state

Scheduled Pinned Locked Moved C / C++ / MFC
helpdatabasejsonquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Sandeep Shetty
    wrote on last edited by
    #1

    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

    P 1 Reply Last reply
    0
    • S Sandeep Shetty

      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

      P Offline
      P Offline
      Paolo Messina
      wrote on last edited by
      #2

      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

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups