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#
  4. Detecting Hybernation

Detecting Hybernation

Scheduled Pinned Locked Moved C#
csharpwpfquestion
3 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.
  • G Offline
    G Offline
    gmarappledude
    wrote on last edited by
    #1

    I am writing a WPF application which shows video content. The PC will run 24 hours a day and is protected from power loss by a UPS. If the mains power goes down for over a minute, the UPS software sends the PC into hybernation. When the power is restored the PC resumes, however... The application which was showing the video now shows nothing (blank space). Is there a way of detecting the immanent hybernation in order to gracefully stop the videos, and restart them or the application when the PC resumes?

    gmar

    L 1 Reply Last reply
    0
    • G gmarappledude

      I am writing a WPF application which shows video content. The PC will run 24 hours a day and is protected from power loss by a UPS. If the mains power goes down for over a minute, the UPS software sends the PC into hybernation. When the power is restored the PC resumes, however... The application which was showing the video now shows nothing (blank space). Is there a way of detecting the immanent hybernation in order to gracefully stop the videos, and restart them or the application when the PC resumes?

      gmar

      L Offline
      L Offline
      leppie
      wrote on last edited by
      #2

      Looking at Microsoft.Win32.SystemEvents.PowerModeChanged might help.

      xacc.ide
      The rule of three: "The first time you notice something that might repeat, don't generalize it. The second time the situation occurs, develop in a similar fashion -- possibly even copy/paste -- but don't generalize yet. On the third time, look to generalize the approach."

      G 1 Reply Last reply
      0
      • L leppie

        Looking at Microsoft.Win32.SystemEvents.PowerModeChanged might help.

        xacc.ide
        The rule of three: "The first time you notice something that might repeat, don't generalize it. The second time the situation occurs, develop in a similar fashion -- possibly even copy/paste -- but don't generalize yet. On the third time, look to generalize the approach."

        G Offline
        G Offline
        gmarappledude
        wrote on last edited by
        #3

        Thank you that is definitely worth looking up.

        gmar

        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