代码:
.586
.model flat, stdcall
option casemap:none
include windows.inc
include user32.inc
include kernel32.inc
includelib user32.lib
includelib kernel32.lib
include macros.asm
.code
start:
invoke FindWindow,CTXT("Shell_TrayWnd"),NULL
invoke SendMessage,eax, WM_SYSCOMMAND, SC_MONITORPOWER,2
invoke ExitProcess,0
end start
说明:
WM_ 窗口消息前缀
WM_SYSCOMMAND 意为“窗口消息_系统指令”
SC_ 系统指令
SC_MONITORPOWER 意为“系统指令_显示器电源”
———————————————Ver0.1———————————————
对于最后一个参数的含义如下:
-1 (the display is powering on) 打开显示器
1 (the display is going to low power) 低电状态
2 (the display is being shut off) 关闭显示器