I already use some kind of code to turn off the power of the monitor, but I still have a little problem.
This code works fine many times, but after a while the monitor becomes empty. I mean, the screen is completely black, you can’t see anything, but you can see that it is still on. The LCD indicator is still on, but the screen is completely black.
I have no idea why this is happening, maybe some of you know why ... This will never happen if I set up Windows Power settings to turn off the monitor in X minutes, but I need an application for this so that I can call it a label whenever you want.
The code I use looks 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?
source share