#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
不生效