diff --git a/Ninjacrab.PersistentWindows.Solution/Common/HotKeyWindow.Designer.cs b/Ninjacrab.PersistentWindows.Solution/Common/HotKeyWindow.Designer.cs index 6e0a1f7..0459d30 100644 --- a/Ninjacrab.PersistentWindows.Solution/Common/HotKeyWindow.Designer.cs +++ b/Ninjacrab.PersistentWindows.Solution/Common/HotKeyWindow.Designer.cs @@ -119,7 +119,7 @@ namespace PersistentWindows.Common this.buttonPrevUrl.Size = new System.Drawing.Size(72, 45); this.buttonPrevUrl.TabIndex = 6; this.buttonPrevUrl.TabStop = false; - this.buttonPrevUrl.Text = "Prev Url"; + this.buttonPrevUrl.Text = "Prev Url"; this.buttonPrevUrl.UseVisualStyleBackColor = false; this.buttonPrevUrl.Click += new System.EventHandler(this.buttonPrevUrl_Click); // @@ -131,7 +131,7 @@ namespace PersistentWindows.Common this.buttonNextUrl.Size = new System.Drawing.Size(72, 45); this.buttonNextUrl.TabIndex = 7; this.buttonNextUrl.TabStop = false; - this.buttonNextUrl.Text = "Next Url"; + this.buttonNextUrl.Text = "Next Url"; this.buttonNextUrl.UseVisualStyleBackColor = false; this.buttonNextUrl.Click += new System.EventHandler(this.buttonNextUrl_Click); // @@ -148,7 +148,7 @@ namespace PersistentWindows.Common this.Controls.Add(this.buttonCloseTab); this.Controls.Add(this.buttonNextTab); this.Controls.Add(this.buttonPrevTab); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D; this.KeyPreview = true; this.MaximizeBox = false; this.MinimizeBox = false; diff --git a/Ninjacrab.PersistentWindows.Solution/Common/HotKeyWindow.cs b/Ninjacrab.PersistentWindows.Solution/Common/HotKeyWindow.cs index 6e43232..0e16831 100644 --- a/Ninjacrab.PersistentWindows.Solution/Common/HotKeyWindow.cs +++ b/Ninjacrab.PersistentWindows.Solution/Common/HotKeyWindow.cs @@ -30,6 +30,8 @@ namespace PersistentWindows.Common Move += new EventHandler(FormMove); FormClosing += new FormClosingEventHandler(FormClose); + Icon = PersistentWindowProcessor.icon; + aliveTimer = new System.Timers.Timer(2000); aliveTimer.Elapsed += AliveTimerCallBack; aliveTimer.SynchronizingObject = this; diff --git a/Ninjacrab.PersistentWindows.Solution/Common/PersistentWindowProcessor.cs b/Ninjacrab.PersistentWindows.Solution/Common/PersistentWindowProcessor.cs index 4d61c96..374e933 100644 --- a/Ninjacrab.PersistentWindows.Solution/Common/PersistentWindowProcessor.cs +++ b/Ninjacrab.PersistentWindows.Solution/Common/PersistentWindowProcessor.cs @@ -170,7 +170,7 @@ namespace PersistentWindows.Common private readonly List winEventHooks = new List(); private User32.WinEventDelegate winEventsCaptureDelegate; - public System.Drawing.Icon icon = null; + public static System.Drawing.Icon icon = null; private int leftButtonClicks = 0; diff --git a/Ninjacrab.PersistentWindows.Solution/SystrayShell/HotKey.cs b/Ninjacrab.PersistentWindows.Solution/SystrayShell/HotKey.cs index d3cefc9..a0a6046 100644 --- a/Ninjacrab.PersistentWindows.Solution/SystrayShell/HotKey.cs +++ b/Ninjacrab.PersistentWindows.Solution/SystrayShell/HotKey.cs @@ -10,11 +10,10 @@ namespace PersistentWindows.SystrayShell public class HotKeyForm : Form { static HotKeyWindow hkwin = null; - static Thread messageLoop = null; public static void Start() { - messageLoop = new Thread(() => + Thread messageLoop = new Thread(() => { hkwin = new HotKeyWindow(); Application.Run(new HotKeyForm()); @@ -26,10 +25,10 @@ namespace PersistentWindows.SystrayShell messageLoop.Start(); } + public HotKeyForm() { //InitializeComponent(); - var r = User32.RegisterHotKey(this.Handle, 0, (int)User32.KeyModifier.Alt, 0x51); // Register Alt + Q } @@ -58,12 +57,27 @@ namespace PersistentWindows.SystrayShell base.SetVisibleCore(false); } - ~HotKeyForm() + /* +#region IDisposable + public virtual void Dispose(bool disposing) { - messageLoop.Abort(); + //messageLoop.Abort(); User32.UnregisterHotKey(this.Handle, 0); } + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + + ~HotKeyForm() + { + Dispose(false); + } +#endregion + */ + } } diff --git a/Ninjacrab.PersistentWindows.Solution/SystrayShell/Program.cs b/Ninjacrab.PersistentWindows.Solution/SystrayShell/Program.cs index 51d2fee..d0e07ad 100644 --- a/Ninjacrab.PersistentWindows.Solution/SystrayShell/Program.cs +++ b/Ninjacrab.PersistentWindows.Solution/SystrayShell/Program.cs @@ -310,7 +310,7 @@ namespace PersistentWindows.SystrayShell else systrayForm.upgradeNoticeMenuItem.Text = "Enable upgrade notice"; - pwp.icon = IdleIcon; + PersistentWindowProcessor.icon = IdleIcon; if (fix_zorder_specified) { if (fix_zorder)