In response to national saving calls,
Contribute a little bit of power to the country,
I decided,
Turn off the monitor,
It also prolongs the service life of the notebook ..
Of course, on the desktop, directly turn off the display power.
In a notebook, you can only turn off the screen backlight by using the FN shortcut on the keyboard,
The signal output from the motherboard to the screen cannot be switched off. You will still see the dark desktop after careful reading.
I suggest you do not need to wait for your notebook on a regular basis .. It has a great impact on hard disks...
In the "power management" of the desktop display attribute, we can adjust the power supply scheme,
Set the computer to disable the monitor, hard disk, and standby after X minutes. And so on...
Command Behavior:
Powercfg/change "power solution name"/moniter-timeout-ac 1
This is troublesome and you need to know the current power supply solution.
However, windows provides us with an API. You can immediately disable the monitor.
LRESULT
WINAPI SendMessage(
__in
HWND
hWnd,
__in
UINT
Msg,
__in
WPARAM
wParam,
__in
LPARAM
lParam
);
See: http://msdn.microsoft.com/en-us/library/ms644950 (VS.85). aspx
This API is signed as follows in the platform call:
1
//C# Signature:
2
[DllImport(
"user32.dll"
, CharSet = CharSet.Auto)]
3
static
extern
IntPtr SendMessage(IntPtr hWnd, UInt32 Msg, IntPtr wParam, IntPtr lParam);
Each parameter type of this method has some heavy loads. IntPtr is recommended. Otherwise, the 64-bit platform OR other situations may crash ~
We need to send Msg a system message, that is, WM_SYSCOMMAND
Then there is additional information, such as Screen Protection: SC _SCREENSAVE, monitor power: SC _MONITORPOWER
WM_SYSCOMMAND has the following values:
enum
SysCommands :
int
{
SC_SIZE = 0xF000,
SC_MOVE = 0xF010,
SC_MINIMIZE = 0xF020,
SC_MAXIMIZE = 0xF030,
SC_NEXTWINDOW = 0xF040,
SC_PREVWINDOW = 0xF050,
SC_CLOSE = 0xF060,
SC_VSCROLL = 0xF070,
SC_HSCROLL = 0xF080,
SC_MOUSEMENU = 0xF090,
SC_KEYMENU = 0xF100,
SC_ARRANGE = 0xF110,
SC_RESTORE = 0xF120,