[已解决]IE内嵌不能禁止右键,求大侠解决下
本帖最后由 meekly 于 2011-10-26 14:44 编辑#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <IE.au3>
#include <WindowsConstants.au3>
Opt('MustDeclareVars', 1)
Example()
Func Example()
Local $oIE, $GUIActiveX, $GUI_Button_Back, $GUI_Button_Forward, $GUI_Button_Leixing,$GUI_CHECKED
Local $GUI_Button_Home, $GUI_Button_Stop, $msg, $oForm, $oText,$cols,$lForm
$oIE = ObjCreate("Shell.Explorer.2")
GUICreate("工单系统", 800, 600, (@DesktopWidth - 800) / 2, (@DesktopHeight - 600) / 2, BitOR($WS_CAPTION,$WS_POPUP,$WS_SYSMENU))
$GUIActiveX = GUICtrlCreateObj ($oIE, -230, -250, 1024, 750)
$GUI_Button_Back = GUICtrlCreateButton("填入IP", 10, 550, 100, 30)
$GUI_Button_Forward = GUICtrlCreateButton("刷新", 230, 550, 100, 30)
$GUI_Button_Stop = GUICtrlCreateButton("关闭", 470, 550, 100, 30)
GUISetState()
$oIE.navigate("http://www.xxx.com")
; Waiting for user to close the window
While 1
$msg = GUIGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE
ExitLoop
Case $msg = $GUI_Button_Home
Case $msg = $GUI_Button_Back
$oForm = _IEFormGetObjByName ($oIE, "ds")
$oText = _IEFormElementGetObjByName ($oForm, "example1")
_IEFormElementSetValue ($oText, "116.255.150.243")
Case $msg = $GUI_Button_Forward
Send("{F5}")
Case $msg = $GUI_Button_Leixing
Case $msg = $GUI_Button_Stop
Exit
EndSelect
WEnd
GUIDelete()
EndFunc 顶上去,求解决 回复 2# meekly
去官网找找,好像见过,不过不太用ie,没记着 还有如何禁止更改GUI创建的这个界面的大小,就是鼠标移到边缘时不会有上下箭头。 _IEHeadInsertEventScript ($oIE, "document", "oncontextmenu", "alert('No Context Menu');return false")
xzxnovice 发表于 2011-10-26 12:49 http://www.autoitx.com/images/common/back.gif
使用的是$oIE.navigate("")
不是_IE_Example ( [模块 = "basic"] )
这样禁用不了 #include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <IE.au3>
#include <WindowsConstants.au3>
Opt('MustDeclareVars', 1)
Example()
Func Example()
Local $oIE, $GUIActiveX, $GUI_Button_Back, $GUI_Button_Forward, $GUI_Button_Leixing,$GUI_CHECKED
Local $GUI_Button_Home, $GUI_Button_Stop, $msg, $oForm, $oText,$cols,$lForm
$oIE = ObjCreate("Shell.Explorer.2")
GUICreate("工单系统", 800, 600, (@DesktopWidth - 800) / 2, (@DesktopHeight - 600) / 2, BitOR($WS_CAPTION,$WS_POPUP,$WS_SYSMENU))
$GUIActiveX = GUICtrlCreateObj ($oIE, -230, -250, 1024, 750)
$GUI_Button_Back = GUICtrlCreateButton("填入IP", 10, 550, 100, 30)
$GUI_Button_Forward = GUICtrlCreateButton("刷新", 230, 550, 100, 30)
$GUI_Button_Stop = GUICtrlCreateButton("关闭", 470, 550, 100, 30)
GUISetState()
$oIE.navigate("http://www.baidu.com")
_IELoadWait($oIE,1000)
_IEHeadInsertEventScript ($oIE, "document", "oncontextmenu", "alert('No Context Menu');return false")
; Waiting for user to close the window
While 1
$msg = GUIGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE
ExitLoop
Case $msg = $GUI_Button_Home
Case $msg = $GUI_Button_Back
$oForm = _IEFormGetObjByName ($oIE, "ds")
$oText = _IEFormElementGetObjByName ($oForm, "example1")
_IEFormElementSetValue ($oText, "116.255.150.243")
Case $msg = $GUI_Button_Forward
Send("{F5}")
Case $msg = $GUI_Button_Leixing
Case $msg = $GUI_Button_Stop
Exit
EndSelect
WEnd
GUIDelete()
EndFunc确定不行?我这里行的,倒是_IELoadWait 函数在我这里有问题,一直在等待所以了个参数1000 谢谢 xzxnovice
页:
[1]