From dd429c1df7b7c4c9d38411f503433f35baeadcd3 Mon Sep 17 00:00:00 2001 From: Kang Yu Date: Mon, 1 Apr 2024 11:11:30 -0700 Subject: [PATCH] invoke hotkey to show icon --- Ninjacrab.PersistentWindows.Solution/SystrayShell/HotKey.cs | 2 ++ Ninjacrab.PersistentWindows.Solution/SystrayShell/Program.cs | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Ninjacrab.PersistentWindows.Solution/SystrayShell/HotKey.cs b/Ninjacrab.PersistentWindows.Solution/SystrayShell/HotKey.cs index 4c38865..fd34448 100644 --- a/Ninjacrab.PersistentWindows.Solution/SystrayShell/HotKey.cs +++ b/Ninjacrab.PersistentWindows.Solution/SystrayShell/HotKey.cs @@ -43,6 +43,8 @@ namespace PersistentWindows.SystrayShell User32.KeyModifier modifier = (User32.KeyModifier)((int)m.LParam & 0xFFFF); // The modifier of the hotkey that was pressed. int id = m.WParam.ToInt32(); // The id of the hotkey that was pressed. + Program.ShowRestoreTip(); + Program.HideRestoreTip(); //show icon hkwin.HotKeyPressed(); return; } diff --git a/Ninjacrab.PersistentWindows.Solution/SystrayShell/Program.cs b/Ninjacrab.PersistentWindows.Solution/SystrayShell/Program.cs index 2595038..b54d925 100644 --- a/Ninjacrab.PersistentWindows.Solution/SystrayShell/Program.cs +++ b/Ninjacrab.PersistentWindows.Solution/SystrayShell/Program.cs @@ -388,7 +388,7 @@ namespace PersistentWindows.SystrayShell return false; } - static void ShowRestoreTip() + public static void ShowRestoreTip() { if (systrayForm.contextMenuStripSysTray.InvokeRequired) systrayForm.contextMenuStripSysTray.BeginInvoke((Action)delegate () @@ -414,7 +414,7 @@ namespace PersistentWindows.SystrayShell } } - static void HideRestoreTip() + public static void HideRestoreTip() { if (systrayForm.contextMenuStripSysTray.InvokeRequired) systrayForm.contextMenuStripSysTray.BeginInvoke((Action)delegate ()