Is it possible to turn monitor's power off programmatically?
In everything I have seen, including Turn on/off monitor , what people refer to "off" is actually standby mode.
I'm looking specifically for completely powered off as in the same functionality as pressing the power button. The below code works to put the monitor into standby mode, however, this isn't quite what I'm looking for.
using System;
using System.Runtime.InteropServices;
namespace ScreenSleep
{
class Program
{
private const int HWND_BROADCAST = 0xFFFF;
private static int WM_SYSCOMMAND = 0x0112;
private static int SC_MONITORPOWER = 0xF170;
[DllImport("user32.dll", CharSet = CharSet.Auto)]
private static extern int SendNotifyMessage(IntPtr hWnd, int wMsg, IntPtr wParam, IntPtr lParam);
public static void Main(string[] args)
{
SendNotifyMessage((IntPtr)HWND_BROADCAST, WM_SYSCOMMAND, (IntPtr)SC_MONITORPOWER, (IntPtr)2);
}
}
}
As I'm sure I will get replies telling me to just press the power button if that's what I want, or that standby mode uses barely more power, let me explain why those are not ideal:
I work for a broadcast company so there are walls full of monitors for various tasks, the power button is difficult to reach. While all monitors are used first thing in the morning, the number of used monitors slowly decreases throughout the day. As personnel leave the office, if they are the last one using a designated monitor for the day, they need to turn it off. However, being difficult to reach the buttons and the layout of video walls, we don't want people constantly going back there to power off monitors and risk pulling any plugs accidentally. The morning supervisor would then physically press the power buttons upon arrival every morning to power them all back on, so there is no need for a software based solution for that. There is also a corporate mandate to not leave monitors in standby mode overnight so that isn't an option.