Is it possible to put a single monitor to sleep using WinAPI/C#?

By using the Windows API it is possible to put the monitors into sleep mode:

[DllImport("user32.dll")]
static extern IntPtr SendMessage(IntPtr hWnd, uint Msg, IntPtr wParam, IntPtr lParam);

and then

SendMessage(this.Handle, WM_SYSCOMMAND, (IntPtr)SC_MONITORPOWER, (IntPtr)2);

When running the command above, both monitors go to sleep. Is it possible to make this affect only one of multiple connected monitors?

8
задан Bergi 2 December 2014 в 11:50
поделиться