You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
63 lines
1.1 KiB
63 lines
1.1 KiB
#Persistent
|
|
#SingleInstance
|
|
|
|
RegKey := "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings"
|
|
ProxyEnabled = False
|
|
MenuItem := "Enable Proxy (Win+Ctrl+Shift+P)"
|
|
|
|
Menu, Tray, NoMainWindow
|
|
Menu, Tray, NoStandard
|
|
|
|
Menu, Tray, Add, %MenuItem%, ToggleProxy
|
|
Menu, Tray, Add, Proxy Settings, ProxySetting
|
|
Menu, Tray, Add
|
|
Menu, Tray, Add, Exit, ExitApp
|
|
|
|
Menu, Tray, Default, %MenuItem%
|
|
|
|
UpdateProxyState()
|
|
return
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
#^+p::
|
|
Goto, ToggleProxy
|
|
return
|
|
|
|
UpdateProxyState(){
|
|
global RegKey, ProxyEnabled, MenuItem
|
|
RegRead, ProxyEnabled, %RegKey%, ProxyEnable
|
|
if (ProxyEnabled)
|
|
{
|
|
Menu, Tray, Tip, Proxy On
|
|
Menu, Tray, Icon, imageres.dll, 226
|
|
Menu, Tray, Check, %MenuItem%
|
|
}
|
|
Else
|
|
{
|
|
Menu, Tray, Tip, Proxy Off
|
|
Menu, Tray, Icon, imageres.dll, 260
|
|
Menu, Tray, UnCheck, %MenuItem%
|
|
}
|
|
}
|
|
|
|
ToggleProxy:
|
|
UpdateProxyState()
|
|
If (ProxyEnabled)
|
|
{
|
|
RegWrite, REG_DWORD, %RegKey%, ProxyEnable, 0
|
|
}
|
|
Else
|
|
{
|
|
RegWrite, REG_DWORD, %RegKey%, ProxyEnable, 1
|
|
}
|
|
UpdateProxyState()
|
|
return
|
|
|
|
ProxySetting:
|
|
RunWait, ms-settings:network-proxy
|
|
return
|
|
|
|
ExitApp:
|
|
ExitApp
|
|
return
|