code cleanup

This commit is contained in:
Kang Yu 2024-05-10 14:46:59 -07:00
parent c41ab850bc
commit 30d2efad08
2 changed files with 4 additions and 10 deletions

View file

@ -10,7 +10,6 @@ namespace PersistentWindows.SystrayShell
public class HotKeyForm : Form
{
static HotKeyWindow hkwin = null;
static IntPtr handle;
static Thread messageLoop;
public static void Start(uint hotkey)
@ -32,7 +31,6 @@ namespace PersistentWindows.SystrayShell
{
//InitializeComponent();
var r = User32.RegisterHotKey(this.Handle, 0, (int)User32.KeyModifier.Alt, hotkey); // Register Alt + W
handle = this.Handle;
}
protected override void WndProc(ref Message m)
@ -50,7 +48,7 @@ namespace PersistentWindows.SystrayShell
Program.HideRestoreTip(false); //hide icon
Program.HideRestoreTip(); //show icon
hkwin.HotKeyPressed(this.Handle, from_menu : false);
hkwin.HotKeyPressed(from_menu : false);
return;
}
else if (m.Msg == 0x0010 || m.Msg == 0x0002)
@ -65,7 +63,7 @@ namespace PersistentWindows.SystrayShell
{
Program.HideRestoreTip(false); //hide icon
Program.HideRestoreTip(); //show icon
hkwin.HotKeyPressed(handle, from_menu: true);
hkwin.HotKeyPressed(from_menu: true);
}
protected override void SetVisibleCore(bool value)