From e24a8fff360211176c14883103d3528e01457081 Mon Sep 17 00:00:00 2001 From: Markus Hofknecht Date: Sun, 28 Jun 2020 20:20:19 +0200 Subject: [PATCH] #115, version 0.11.2.1 [Feature] Show icon in taskbar when application is running #115 --- Business/App.cs | 17 ++++++++++++++--- Properties/AssemblyInfo.cs | 4 ++-- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/Business/App.cs b/Business/App.cs index d8c2a9b..2fe4924 100644 --- a/Business/App.cs +++ b/Business/App.cs @@ -50,21 +50,32 @@ namespace SystemTrayMenu private void TaskbarForm_Resize(object sender, EventArgs e) { - taskbarForm.WindowState = FormWindowState.Normal; + SetStateNormal(); } internal void TasbkarItemActivated(object sender, EventArgs e) { - taskbarForm.WindowState = FormWindowState.Normal; + SetStateNormal(); taskbarForm.Activate(); taskbarForm.Focus(); menus.SwitchOpenCloseByTaskbarItem(); } + private void TaskbarForm_Deactivate(object sender, EventArgs e) { - taskbarForm.WindowState = FormWindowState.Normal; + SetStateNormal(); } + /// + /// This ensures that next click on taskbaritem works as activate event/click event + /// + private void SetStateNormal() + { + if (Form.ActiveForm == taskbarForm) + { + taskbarForm.WindowState = FormWindowState.Normal; + } + } public void Dispose() { taskbarForm.Dispose(); diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs index 4dc32d0..83e6f69 100644 --- a/Properties/AssemblyInfo.cs +++ b/Properties/AssemblyInfo.cs @@ -35,5 +35,5 @@ using System.Runtime.InteropServices; // 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("0.11.2.0")] -[assembly: AssemblyFileVersion("0.11.2.0")] +[assembly: AssemblyVersion("0.11.2.1")] +[assembly: AssemblyFileVersion("0.11.2.1")]