Archie Lu
4 years ago
1 changed files with 63 additions and 0 deletions
@ -0,0 +1,63 @@ |
|||
#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 |
Loading…
Reference in new issue