利用DLLCALL调用Sendmessage关闭monitor的不解之处
本帖最后由 whitegod 于 2009-5-31 02:17 编辑Local $HWND = WinGetHandle("classname=Progman")
Switch StringUpper($io_control)
Case "OFF"
DllCall("user32.dll", "int", "SendMessage", "hwnd",$HWND, "int","274", "int", "61808", "int", 2)
上面的代码可以关闭显示器.从原理上来讲,应该是让VGA不输出信号来实现的.为什么在调用Sendmessage API的时候, 用276,61808,2 这三个整形呢,这个问题,我查了很多资料,还是没法解答,哪位高手可以源源本本的将这个问题说一下呀,小弟不胜感激.
各位也可加我QQ:250959705 SendMessage(hwnd, WM_SYSCOMMAND, SC_MONITORPOWER,1)
Winuser.h
#define WM_SYSCOMMAND 0x0112
#define SC_MONITORPOWER 0xF170
google SC_MONITORPOWER 补充:
http://msdn.microsoft.com/en-us/library/ms646360(VS.85).aspx
SC_MONITORPOWER
Sets the state of the display. This command supports devices that have power-saving features, such as a battery-powered personal computer.
The lParam parameter can have the following values:
-1 - the display is powering on
1 - the display is going to low power
2 - the display is being shut off sensel,Thank you very much. msdn耶,都是高手哦 学习了,很好 学习了3l~
页:
[1]