找回密码
 加入
搜索
查看: 3497|回复: 7

[GUI管理] [已解决]IE内嵌不能禁止右键,求大侠解决下

  [复制链接]
发表于 2011-10-25 20:44:13 | 显示全部楼层 |阅读模式
本帖最后由 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
 楼主| 发表于 2011-10-26 10:48:00 | 显示全部楼层
顶上去,求解决
发表于 2011-10-26 10:50:32 | 显示全部楼层
回复 2# meekly
去官网找找,好像见过,不过不太用ie,没记着
 楼主| 发表于 2011-10-26 11:01:57 | 显示全部楼层
还有如何禁止更改GUI创建的这个界面的大小,就是鼠标移到边缘时不会有上下箭头。
发表于 2011-10-26 12:49:16 | 显示全部楼层
_IEHeadInsertEventScript ($oIE, "document", "oncontextmenu", "alert('No Context Menu');return false")
 楼主| 发表于 2011-10-26 13:58:34 | 显示全部楼层
xzxnovice 发表于 2011-10-26 12:49


使用的是$oIE.navigate("")
不是_IE_Example ( [模块 = "basic"] )
这样禁用不了
发表于 2011-10-26 14:21:40 | 显示全部楼层
#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
 楼主| 发表于 2011-10-26 14:43:32 | 显示全部楼层
谢谢 xzxnovice
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-6-18 00:31 , Processed in 0.102159 second(s), 24 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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