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

如何禁止IE右键。。

[复制链接]
发表于 2009-12-13 15:51:25 | 显示全部楼层 |阅读模式
本帖最后由 zhenglei 于 2009-12-14 19:34 编辑

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include<ie.au3>

$Form1 = GUICreate("Form1", 800, 600,1,1,  BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS, $WS_CLIPCHILDREN))
$oIE = ObjCreate("Shell.Explorer.2")

GUICtrlCreateObj($oIE, 50, 50, 700, 400)

$oIE.navigate("http://www.baidu.com/")

GUISetState(@SW_SHOW)

While 1

        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit

        EndSwitch
WEnd


以上代码如何禁止打开的网页IE右键。。
发表于 2009-12-14 19:20:10 | 显示全部楼层
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include<ie.au3>

$Form1 = GUICreate("Form1", 800, 600,1,1,  BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS, $WS_CLIPCHILDREN))
$oIE = _IECreateEmbedded ()
GUICtrlCreateObj($oIE, 50, 50, 700, 400)

_IENavigate ($oIE, "http://www.baidu.com/")

_IEHeadInsertEventScript($oIE, "document", "oncontextmenu", "return false")        

GUISetState(@SW_SHOW)


While 1

        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit

        EndSwitch
WEnd

评分

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

查看全部评分

发表于 2010-1-12 15:48:28 | 显示全部楼层
二楼的代码 只能在默认打开的时候 禁止右键    如果页面切换后就不能了
发表于 2010-1-31 19:53:28 | 显示全部楼层
原理就是在指定打开的网页上!加一个JS脚本!治标不治本!
_IEHeadInsertEventScript($oIE, "document", "oncontextmenu", "return false")  
这里是技术的关键代码!
发表于 2012-6-9 10:42:54 | 显示全部楼层
回复 3# 非典男人


    _IENavigate ($oIE, "http://www.baidu.com/")

在while之前有这行的话,在while里添加
_IEHeadInsertEventScript($oIE, "document", "oncontextmenu", "return false")  
就可以再切换之后也禁用

这贴好像沉底了。还能回复
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-9-30 09:20 , Processed in 0.082516 second(s), 24 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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