how to detect a display turn off RRS feed

  • Question

  • Hi,

    We have a situation where the customer wants to know when a display (connected to a pc) is turned off through the remote control or when someone is physically turning off the display power button.

    Is there an event/other way to get information about the status of the display?

    Wednesday, April 30, 2014 12:51 PM

All replies

  • If you add a reference to System.Windows.Forms.dll you can access the System.Windows.Forms.Screen.AllScreens collection to get information about the devices that are currently being used: http://stackoverflow.com/questions/1538602/find-number-and-resolution-to-all-monitors

    There is not any built-in managed event that is being raised as devices are added or removed from this collection though. You may want to check out the Windows API Code Pack which is a set of managed wrappers that maps Windows paradigms into .NET ones: http://stackoverflow.com/questions/6530968/check-if-display-is-turned-off-by-windows-power-management

    However, this is not really a WPF subject and you will probably get more replies if you post your questions regarding this subject in a another forum.

    Wednesday, April 30, 2014 1:14 PM
  • Hi, thanks fro your reply.

    The screen settings stay the same when you turn off the display (hardware)
    This will not let me identify if someone turned off the display.

    The api code pack powermanager only tells you if windows turned the desktop off, not the physical monitor attached.

    I need to know if the physical monitor (hardware) is turned off by for example using the power on/off knob on the monitor device.

    Wednesday, April 30, 2014 1:50 PM