mirror of
https://github.com/kangyu-california/PersistentWindows.git
synced 2025-05-13 05:55:39 +02:00
automatically gray restore menu if not captured to disk yet
This commit is contained in:
parent
b1e586af07
commit
1bce0333b5
4 changed files with 30 additions and 17 deletions
|
@ -37,24 +37,29 @@ namespace Ninjacrab.PersistentWindows.SystrayShell
|
|||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Mutex singleInstMutex = new Mutex(true, Application.ProductName);
|
||||
if (!singleInstMutex.WaitOne(TimeSpan.Zero, true))
|
||||
{
|
||||
MessageBox.Show($"Only one inst of {Application.ProductName} can be run!");
|
||||
//Application.Exit();
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
singleInstMutex.ReleaseMutex();
|
||||
}
|
||||
*/
|
||||
/*
|
||||
Mutex singleInstMutex = new Mutex(true, Application.ProductName);
|
||||
if (!singleInstMutex.WaitOne(TimeSpan.Zero, true))
|
||||
{
|
||||
MessageBox.Show($"Only one inst of {Application.ProductName} can be run!");
|
||||
//Application.Exit();
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
singleInstMutex.ReleaseMutex();
|
||||
}
|
||||
*/
|
||||
|
||||
Application.EnableVisualStyles();
|
||||
Application.SetCompatibleTextRenderingDefault(false);
|
||||
systrayForm = new SystrayForm();
|
||||
|
||||
pwp = new PersistentWindowProcessor();
|
||||
pwp.dryRun = dry_run;
|
||||
pwp.showRestoreTip = ShowRestoreTip;
|
||||
pwp.hideRestoreTip = HideRestoreTip;
|
||||
pwp.enableRestoreMenu = EnableRestoreMenu;
|
||||
|
||||
if (!pwp.Start())
|
||||
{
|
||||
|
@ -66,9 +71,6 @@ namespace Ninjacrab.PersistentWindows.SystrayShell
|
|||
StartSplashForm();
|
||||
}
|
||||
|
||||
Application.EnableVisualStyles();
|
||||
Application.SetCompatibleTextRenderingDefault(false);
|
||||
systrayForm = new SystrayForm();
|
||||
Application.Run();
|
||||
}
|
||||
|
||||
|
@ -90,6 +92,11 @@ namespace Ninjacrab.PersistentWindows.SystrayShell
|
|||
systrayForm.notifyIconMain.Visible = true;
|
||||
}
|
||||
|
||||
static void EnableRestoreMenu(bool enable)
|
||||
{
|
||||
systrayForm.restoreToolStripMenuItem.Enabled = enable;
|
||||
}
|
||||
|
||||
static void StartSplashForm()
|
||||
{
|
||||
var thread = new Thread(() =>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue