Skip to content

Commit

Permalink
Add 'Proxy Setting' menu item
Browse files Browse the repository at this point in the history
  • Loading branch information
Lingxi-Li committed Aug 2, 2023
1 parent d82df16 commit ef5edb4
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
11 changes: 9 additions & 2 deletions Program.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Microsoft.Win32;
using System;
using System.Diagnostics;
using System.Drawing;
using System.Management;
using System.Security.Principal;
Expand Down Expand Up @@ -35,15 +36,21 @@ static void Initialize()

static void CreateTray()
{
var menuItem = new MenuItem
var settingItem = new MenuItem
{
Index = 0,
Text = "Proxy Setting"
};
settingItem.Click += (sender, e) => Process.Start("ms-settings:network-proxy");
var menuItem = new MenuItem
{
Index = 1,
Text = "Quit"
};
menuItem.Click += (sender, e) => Application.Exit();
Tray = new NotifyIcon
{
ContextMenu = new ContextMenu(new[] { menuItem }),
ContextMenu = new ContextMenu(new[] { settingItem, menuItem }),
Visible = true
};
Tray.MouseClick += (sender, e) =>
Expand Down
4 changes: 2 additions & 2 deletions Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyVersion("1.1.0.0")]
[assembly: AssemblyFileVersion("1.1.0.0")]
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ A Windows tray app that monitors WinINet proxy settings for LAN (not VPN) and en
- A blue/yellow tray icon indicates proxy off/on status, respectively.
- A mouse hover-over tip shows proxy server info when proxy is on or "Direct" when off.
- Left click on the tray icon toggles proxy on/off status. Proxy server info must be pre-configured externally.
- Quit with "Quit" in right-click context menu.
- Right-click opens context menu.
- "Proxy Setting" opens Windows network proxy setting panel.
- "Quit" exits the tray app.

Targets .NET Framework 4.8 that is included in Windows 11.

0 comments on commit ef5edb4

Please sign in to comment.