找回密码
 加入
搜索
查看: 3322|回复: 4

[GUI管理] 如何在范围内让鼠标和键盘的操作无效(已解决)

[复制链接]
发表于 2010-8-18 10:47:21 | 显示全部楼层 |阅读模式
本帖最后由 shenrenba 于 2010-8-18 14:59 编辑

比如下面的代码 我想在程序界面中让鼠标和键盘的操作无效 如何添加代码?
#include <IE.au3>
$hGUI = GUICreate("天气预报", 265, 200)
$oIE = _IECreateEmbedded()
GUICtrlCreateObj($oIE, 0, 0, 265, 200)
GUISetState()
_IENavigate($oIE, http://www.soso.com/tb.q)

$colLinks = _IELinkGetCollection($oIE)
For $oLink in $colLinks
If String($oLink.InnerText) = "this link" Then
_IEAction($oLink, "click")
ConsoleWrite("Popup should be displayed" & @LF)
ExitLoop
EndIf
Next

Do
Until GUIGetMsg() = -3

评分

参与人数 1金钱 +10 收起 理由
afan + 10 感谢主动将修改帖子分类为[已解决],请继续 ...

查看全部评分

发表于 2010-8-18 11:23:03 | 显示全部楼层
直接禁用
#include <IE.au3>
$hGUI = GUICreate("天气预报", 265, 200)
$oIE = _IECreateEmbedded()

GUICtrlCreateObj($oIE, 0, 0, 265, 200)
GUISetState()
_IENavigate($oIE, "http://www.soso.com/tb.q")
$colLinks = _IELinkGetCollection($oIE)
For $oLink in $colLinks
If String($oLink.InnerText) = "this link" Then
_IEAction($oLink, "click")
ConsoleWrite("Popup should be displayed" & @LF)
ExitLoop
EndIf
Next

GUISetState(@SW_DISABLE)
Do
Until GUIGetMsg() = -3
发表于 2010-8-18 11:29:04 | 显示全部楼层
本帖最后由 xsjtxy 于 2010-8-18 11:32 编辑

或者鼠标穿透
http://www.autoitx.com/forum.php ... hlight=%B4%A9%CD%B8
#include <WindowsConstants.au3>
#include <IE.au3>

$hGUI = GUICreate("天气预报", 265, 200,-1,0,$WS_POPUP)
$oIE = _IECreateEmbedded()

GUICtrlCreateObj($oIE, 0, 0, 265, 200)
GUISetState()
_IENavigate($oIE, "http://www.soso.com/tb.q")
$colLinks = _IELinkGetCollection($oIE)
For $oLink in $colLinks
If String($oLink.InnerText) = "this link" Then
_IEAction($oLink, "click")
ConsoleWrite("Popup should be displayed" & @LF)
ExitLoop
EndIf
Next

DllCall("user32.dll", "uint", "SetWindowLong", "hWnd", $hGUI, "int", "-20", "uint", BitOR(DllCall("user32.dll", "uint", "GetWindowLong", "hWnd", $hGUI, "int", "-20"), 0x80000, 0x20))
DllCall("user32.dll", "int", "SetLayeredWindowAttributes", "hWnd", $hGUI, "int", 0, "int", 255, "int", 0x2)


Do
Until GUIGetMsg() = -3

评分

参与人数 1金钱 +20 收起 理由
afan + 20

查看全部评分

 楼主| 发表于 2010-8-18 14:58:13 | 显示全部楼层
谢谢 美中不足的地方就是 2中方法的结果就是关闭也点击无效了
发表于 2010-8-18 15:36:58 | 显示全部楼层
用个透明的Label覆盖…
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-6-17 02:57 , Processed in 0.089245 second(s), 29 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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