#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
$zhuce = "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings"
$Form1 = GUICreate("访问网页权限设置", 302, 214, -1,-1)
$zhiding = GUICtrlCreateRadio("充许以上网页访问", 24, 152, 129, 17)
$all = GUICtrlCreateRadio("所有网页均可访问", 160, 152, 113, 17)
$Group1 = GUICtrlCreateGroup("设置", 8, 8, 281, 169)
$wangzhi = GUICtrlCreateEdit("", 19, 28, 257, 113,$ES_AUTOVSCROLL + $WS_VSCROLL)
GUICtrlSetData(-1, "Edit1")
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Button1 = GUICtrlCreateButton("确定", 48, 182, 75, 25)
$Button2 = GUICtrlCreateButton("取消", 168, 183, 75, 25)
GUISetState(@SW_SHOW)
$duzhuce = RegRead($zhuce,"ProxyEnable")
$duxianzhi = RegRead($zhuce,"ProxyOverride")
If $duzhuce="00000001" Then
GUICtrlSetState($zhiding,$GUI_CHECKED)
Else
GUICtrlSetState($all,$GUI_CHECKED)
EndIf
GUICtrlSetData($wangzhi,$duxianzhi)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
xieru()
Case $Button2
Exit
EndSwitch
WEnd
Func xieru()
$duedit = GUICtrlRead($wangzhi)
RegWrite($zhuce,"ProxyOverride","REG_SZ",$duedit)
If GUICtrlRead($zhiding) = 1 Then RegWrite($zhuce,"ProxyEnable","REG_DWORD",1)
If GUICtrlRead($all) = 1 Then RegWrite($zhuce,"ProxyEnable","REG_DWORD",0)
DllCall("user32.dll","int","SendMessageTimeout","hwnd",65535,"int",26,"int",0,"int",0,"int",0,"int",1000,"str","dwResult")
EndFunc