如何在范围内让鼠标和键盘的操作无效(已解决)
本帖最后由 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 直接禁用
#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
本帖最后由 xsjtxy 于 2010-8-18 11:32 编辑
或者鼠标穿透
http://www.autoitx.com/forum.php?mod=viewthread&tid=10334&highlight=%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
谢谢 美中不足的地方就是 2中方法的结果就是关闭也点击无效了 用个透明的Label覆盖…
页:
[1]