Last active
February 9, 2018 12:30
-
-
Save xiaoli/82f7ad298352bb171a37b83dce086b70 to your computer and use it in GitHub Desktop.
Http Proxy Enable/Disable Script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Gui, Add, Button, x46 y20 w100 h30 Gon , Proxy ON | |
Gui, Add, Button, x46 y60 w100 h30 Goff , Proxy OFF | |
Gui, Add, Button, x46 y100 w100 h30 Ggtfo , Exit | |
; Generated using SmartGUI Creator 4.0 | |
Gui, Show, x129 y99 h146 w194, Proxy Status | |
Return | |
on: | |
setproxy("ON", "127.0.0.1:1080") | |
return | |
off: | |
setproxy("OFF") | |
return | |
setproxy(state="", address="") | |
{ | |
if(state = "") | |
state = "ON" | |
if (state ="ON") | |
{ | |
regwrite,REG_SZ,HKCU,Software\Microsoft\Windows\CurrentVersion\Internet Settings,ProxyServer,%address% | |
regwrite,REG_DWORD,HKCU,Software\Microsoft\Windows\CurrentVersion\Internet Settings,Proxyenable,1 | |
} | |
else if (state="OFF") | |
regwrite,REG_DWORD,HKCU,Software\Microsoft\Windows\CurrentVersion\Internet Settings,Proxyenable,0 | |
dllcall("wininet\InternetSetOptionW","int","0","int","39","int","0","int","0") | |
dllcall("wininet\InternetSetOptionW","int","0","int","37","int","0","int","0") | |
Return | |
} | |
;;---------------------------------------------------------- | |
;; Function RegRead | |
;;---------------------------------------------------------- | |
RegRead(RootKey, SubKey, ValueName = "") { | |
RegRead, v, %RootKey%, %SubKey%, %ValueName% | |
Return, v | |
} | |
gtfo: | |
ExitApp | |
GuiClose: | |
ExitApp |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Refer: https://autohotkey.com/board/topic/19498-internet-explorer-windows-proxy-function/