Turn off the monitor completely (not Standby) programmatically

Can I turn off the power of the monitor programmatically?

In everything that I saw, including Turn on / off the monitor , what people call "off" is actually a standby mode.

I am looking specifically for a completely turned off power, both in the same functionality as pressing a power button. The following code works to put the monitor on standby, however this is not quite what I am 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 answers telling me just to press the power button, if this is what I want, or this standby mode uses a little more power, let me explain why they are not perfect:

I work for a broadcast company, so there are walls full of monitors for various tasks, the power button is hard to reach. While all monitors are used primarily in the morning, the number of monitors used is slowly decreasing throughout the day. When staff leave the office, if the last one uses the designated monitor during the day, they need to turn it off. However, it is difficult to get to the buttons and layout of the video walls, we do not want people to constantly return there to turn off the monitors and risk accidentally pulling out any traffic jams. The morning supervisor then physically pressed the power buttons upon arrival every morning to turn them on again, so there was no need for a software solution for this. There is also a corporate mandate not to leave monitors in standby mode overnight, so this is not an option.

+6
source share

All Articles