mirror of
https://github.com/kangyu-california/PersistentWindows.git
synced 2025-05-11 21:15:38 +02:00
try solve exception
This commit is contained in:
parent
60e29af67d
commit
076fc4adc6
1 changed files with 5 additions and 16 deletions
|
@ -10,10 +10,11 @@ namespace PersistentWindows.SystrayShell
|
||||||
public class HotKeyForm : Form
|
public class HotKeyForm : Form
|
||||||
{
|
{
|
||||||
static HotKeyWindow hkwin = null;
|
static HotKeyWindow hkwin = null;
|
||||||
|
static Thread messageLoop;
|
||||||
|
|
||||||
public static void Start(uint hotkey)
|
public static void Start(uint hotkey)
|
||||||
{
|
{
|
||||||
Thread messageLoop = new Thread(() =>
|
messageLoop = new Thread(() =>
|
||||||
{
|
{
|
||||||
hkwin = new HotKeyWindow(hotkey);
|
hkwin = new HotKeyWindow(hotkey);
|
||||||
Application.Run(new HotKeyForm(hotkey));
|
Application.Run(new HotKeyForm(hotkey));
|
||||||
|
@ -58,26 +59,14 @@ namespace PersistentWindows.SystrayShell
|
||||||
base.SetVisibleCore(false);
|
base.SetVisibleCore(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
#region IDisposable
|
#region IDisposable
|
||||||
public virtual void Dispose(bool disposing)
|
|
||||||
{
|
|
||||||
//messageLoop.Abort();
|
|
||||||
User32.UnregisterHotKey(this.Handle, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Dispose()
|
|
||||||
{
|
|
||||||
Dispose(true);
|
|
||||||
GC.SuppressFinalize(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
~HotKeyForm()
|
~HotKeyForm()
|
||||||
{
|
{
|
||||||
Dispose(false);
|
if (messageLoop.IsAlive)
|
||||||
|
messageLoop.Abort();
|
||||||
|
User32.UnregisterHotKey(this.Handle, 0);
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
*/
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue