Hi,
I'm already using some code to turn off the monitor power but I'm still with a little problem.
The code works fine most of times but once a in a while, the monitor turns blank. What I mean by this is that the screen is totally black, you can't see anything, but you can see it's still lit. The LCD light is still turned on but the screen is completely black.
I have no idea why this happens, maybe some of you know why... This will never happen if I set Windows Power settings to turn the monitor off after X minutes, but I need an application to do this so I can call it with a shortcut whenever I want.
The code I'm using is something like this:
[System.Runtime.InteropServices.DllImport("user32.dll")]
private static extern int SendMessage(int hWnd, int hMsg, int wParam, int lParam);
const int WM_SYSCOMMAND = 0x0112;
const int SC_MONITORPOWER = 0xF170;
const int HWND_BROADCAST = 0xFFFF;
SendMessage(HWND_BROADCAST, WM_SYSCOMMAND, SC_MONITORPOWER, 2);
Any ideas?