找回密码
 加入
搜索
查看: 2314|回复: 6

利用DLLCALL调用Sendmessage关闭monitor的不解之处

[复制链接]
发表于 2009-5-31 00:38:01 | 显示全部楼层 |阅读模式
本帖最后由 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
发表于 2009-5-31 01:25:27 | 显示全部楼层
SendMessage(hwnd, WM_SYSCOMMAND, SC_MONITORPOWER,1)

Winuser.h
#define WM_SYSCOMMAND                   0x0112
#define SC_MONITORPOWER 0xF170

google SC_MONITORPOWER
发表于 2009-5-31 01:28:04 | 显示全部楼层
补充:
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
 楼主| 发表于 2009-5-31 02:14:02 | 显示全部楼层
sensel,Thank you very much.
发表于 2009-5-31 09:27:43 | 显示全部楼层
msdn耶,都是高手哦
发表于 2011-12-7 14:02:08 | 显示全部楼层
学习了,很好
发表于 2012-5-8 14:49:57 | 显示全部楼层
学习了  3l~
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-11-19 03:18 , Processed in 0.073657 second(s), 20 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表