找回密码
 加入
搜索
查看: 4525|回复: 1

[系统综合] WebBrowser设置InternetSetOption代理,不影响IE咋弄?

[复制链接]
发表于 2013-4-29 06:23:14 | 显示全部楼层 |阅读模式
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include<IE.au3>
 
Global $ProxyServer ='http=101.226.74.168:8081'
 
Global Const $tagWINHTTP_PROXY_INFO = "DWORD dwAccessType;ptr lpszProxy;ptr lpszProxyBypass;"
Global Const $INTERNET_OPTION_PROXY = 38
Global Const $INTERNET_OPTION_SETTINGS_CHANGED = 39
Global Const $INTERNET_OPEN_TYPE_DIRECT = 1
Global Const $INTERNET_OPEN_TYPE_PROXY = 3
 
$xl = GUICreate("test", 1000, 500) ;
 
GUISetState(@SW_SHOW) 
$ProxyInfo = ProxyInfoCreate($INTERNET_OPEN_TYPE_PROXY, $ProxyServer, "") ;
DllCall("wininet.dll", 'long', 'InternetSetOption', "int",0, 'long', $INTERNET_OPTION_PROXY, 'str', DllStructGetPtr($ProxyInfo[0]), 'long', DllStructGetSize($ProxyInfo[0]))
DllCall("wininet.dll", 'long', 'InternetSetOption', 'int',0, 'long', $INTERNET_OPTION_SETTINGS_CHANGED, 'str',0, 'long', 0) 
Sleep(1000)
 $oIE = _IECreateEmbedded()
$GUIActiveX = GUICtrlCreateObj($oIE, 0, 0, 1100, 500)
$hOpen = GUICtrlGetHandle($GUIActiveX)
$R = _IENavigate ($oIE, "http://www.ip138.com",0)
;Sleep(5000)
;$R = _IENavigate ($oIE, "http://www.cz88.net/ip/viewip468.aspx",0)
 
While 1
        Sleep(10)
        $msg = GUIGetMsg()
        Select
                Case $msg = $GUI_EVENT_CLOSE
                        Exit
                Case $msg = $GUI_EVENT_MINIMIZE
                        Exit
                Case $msg = $GUI_EVENT_MAXIMIZE
                        Exit
        EndSelect
        
WEnd
 
Func ProxyInfoCreate($dwAccessType, $sProxy, $sProxyBypass)
        Local $tWINHTTP_PROXY_INFO[2] = [DllStructCreate($tagWINHTTP_PROXY_INFO), DllStructCreate('wchar proxychars[' & StringLen($sProxy)+1 & ']; wchar proxybypasschars[' & StringLen($sProxyBypass)+1 & ']')]
        DllStructSetData($tWINHTTP_PROXY_INFO[0], "dwAccessType", $dwAccessType)
        If StringLen($sProxy) Then DllStructSetData($tWINHTTP_PROXY_INFO[0], "lpszProxy", DllStructGetPtr($tWINHTTP_PROXY_INFO[1], 'proxychars'))
        If StringLen($sProxyByPass) Then DllStructSetData($tWINHTTP_PROXY_INFO[0], "lpszProxyBypass", DllStructGetPtr($tWINHTTP_PROXY_INFO[1], 'proxybypasschars'))
        DllStructSetData($tWINHTTP_PROXY_INFO[1], "proxychars", $sProxy)
        DllStructSetData($tWINHTTP_PROXY_INFO[1], "proxybypasschars", $sProxyBypass)
        Return $tWINHTTP_PROXY_INFO
EndFunc
不生效
http://www.autoitscript.com/foru ... /page__hl__%2Bproxy
这个貌似只能修改IE,我想要内嵌IE生效的
谁能给点资料也好!
 楼主| 发表于 2013-4-29 06:34:54 | 显示全部楼层
http://msdn.microsoft.com/ZH-CN/library/windows/desktop/aa385328(v=vs.85).aspx

没怎么搞懂 把资料收集起来
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-11-22 01:01 , Processed in 0.077125 second(s), 23 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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