From ff53cc352dca80bb49170e345cf26a53a65d35aa Mon Sep 17 00:00:00 2001 From: Kang Yu Date: Fri, 26 Jul 2024 20:49:57 -0700 Subject: [PATCH] support customized pw update icon with file named as pwIconUpdate(.ico, .png) --- .../SystrayShell/Program.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Ninjacrab.PersistentWindows.Solution/SystrayShell/Program.cs b/Ninjacrab.PersistentWindows.Solution/SystrayShell/Program.cs index d485f3d..944c1d0 100644 --- a/Ninjacrab.PersistentWindows.Solution/SystrayShell/Program.cs +++ b/Ninjacrab.PersistentWindows.Solution/SystrayShell/Program.cs @@ -317,6 +317,18 @@ namespace PersistentWindows.SystrayShell { BusyIcon = new System.Drawing.Icon(icon_path); } + + icon_path = Path.Combine(iconFolder, "pwIconUpdate.ico"); + icon_png_path = Path.Combine(iconFolder, "pwIconUpdate.png"); + if (File.Exists(icon_png_path)) + { + var bitmap = new System.Drawing.Bitmap(icon_png_path); + UpdateIcon = System.Drawing.Icon.FromHandle(bitmap.GetHicon()); + } + else if (File.Exists(icon_path)) + { + UpdateIcon = new System.Drawing.Icon(icon_path); + } } systrayForm = new SystrayForm(check_upgrade);