heavenm 发表于 2013-4-29 06:23:14

WebBrowser设置InternetSetOption代理,不影响IE咋弄?

#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), 'long', DllStructGetSize($ProxyInfo))
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 = ; wchar proxybypasschars[' & StringLen($sProxyBypass)+1 & ']')]
        DllStructSetData($tWINHTTP_PROXY_INFO, "dwAccessType", $dwAccessType)
        If StringLen($sProxy) Then DllStructSetData($tWINHTTP_PROXY_INFO, "lpszProxy", DllStructGetPtr($tWINHTTP_PROXY_INFO, 'proxychars'))
        If StringLen($sProxyByPass) Then DllStructSetData($tWINHTTP_PROXY_INFO, "lpszProxyBypass", DllStructGetPtr($tWINHTTP_PROXY_INFO, 'proxybypasschars'))
        DllStructSetData($tWINHTTP_PROXY_INFO, "proxychars", $sProxy)
        DllStructSetData($tWINHTTP_PROXY_INFO, "proxybypasschars", $sProxyBypass)
        Return $tWINHTTP_PROXY_INFO
EndFunc
不生效
http://www.autoitscript.com/forum/topic/93288-proxy-changer/page__hl__%2Bproxy
这个貌似只能修改IE,我想要内嵌IE生效的
谁能给点资料也好!

heavenm 发表于 2013-4-29 06:34:54

http://msdn.microsoft.com/ZH-CN/library/windows/desktop/aa385328(v=vs.85).aspx

没怎么搞懂 把资料收集起来
页: [1]
查看完整版本: WebBrowser设置InternetSetOption代理,不影响IE咋弄?