Request, ability to turn off display

Jun 10, 2008 at 3:56 PM
First off, I absolutely love the application and am using it to control VMC via Mainlobby, so thanks!

I have a need to turn off my display remotely and would love it if a command was added to your application that would do the same thing the Windows power settings.

The problem in my case -- assuming you care -- is that I have my HDTV connected to my VMC via HDMI. So HDCP is required and when I turn off my HDTV without telling Windows to turn off my display, my logs fill with HDCP handshake error and require me to restart ehshell.exe to recover.

Right now I have Windows set to turn off the display in 15 minutes, the problem is this starts counting down from the last time I hit a button, so when I'm watching a movie without commercials, as soon as the movie is over the screen turns off, which prompts my wife to ask if the TV is broken.

In case you decide to add this feature, here is an example I found of how to turn off the display with C#.

using System;
using System.Runtime.InteropServ
ices;
using System.Windows.Forms;

namespace TurnOffMonitor
{
    public partial class Form1 : Form
    {
        const uint SC_MONITORPOWER = 0xF170;
        const uint WM_SYSCOMMAND = 0x0112;
        const uint MONITOR_ON = 0x0001;
        const uint MONITOR_OFF = 0x0002;

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

        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            SendMessage(this.Handle, WM_SYSCOMMAND, SC_MONITORPOWER, MONITOR_OFF);
        }
    }
}

Found here.
http://www.experts-exchange.com/Programming/Q_20840222.html
hint, scroll all the way to the bottom.

Thanks!
Ben Drawbaugh