Ive included a few examples at the top, but generally usage is
setproxy("Address","state")
where address is the address to change it too, and state can be either on, off or toggle.
setproxy("address.proxy.com")
setproxy("address.proxy2.com","ON")
setproxy("address.proxy.com","OFF")
setproxy()
return
setproxy(address = "",state = ""){
if (address = "") and (state = "")
state = TOGGLE
if address
regwrite,REG_SZ,HKCU,Software\Microsoft\Windows\CurrentVersion\Internet Settings,ProxyServer,%address%
if (state ="ON")
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
else if (state = "TOGGLE")
{
if regread("HKCU","Software\Microsoft\Windows\CurrentVersion\Internet Settings","Proxyenable") = 1
regwrite,REG_DWORD,HKCU,Software\Microsoft\Windows\CurrentVersion\Internet Settings,Proxyenable,0
else if regread("HKCU","Software\Microsoft\Windows\CurrentVersion\Internet Settings","Proxyenable") = 0
regwrite,REG_DWORD,HKCU,Software\Microsoft\Windows\CurrentVersion\Internet Settings,Proxyenable,1
}
dllcall("wininet\InternetSetOptionW","int","0","int","39","int","0","int","0")
dllcall("wininet\InternetSetOptionW","int","0","int","37","int","0","int","0")
Return
}
RegRead(RootKey, SubKey, ValueName = "") {
RegRead, v, %RootKey%, %SubKey%, %ValueName%
Return, v
}Thanks to Titan for the regread function also included here
Thanks also to engunneer and manauser for simplifying and enhancing
Any comments, let me know




