mirror of
https://github.com/kangyu-california/PersistentWindows.git
synced 2025-05-11 04:55:39 +02:00
#354, add command option -restore_snapshot "[0-9a-z]"
This commit is contained in:
parent
5a794baf8b
commit
0e622b8021
2 changed files with 39 additions and 1 deletions
|
@ -567,6 +567,28 @@ namespace PersistentWindows.Common
|
|||
|
||||
}
|
||||
|
||||
public void RestoreSnapshotCmd(int id)
|
||||
{
|
||||
string productName = System.Windows.Forms.Application.ProductName;
|
||||
appDataFolder = redirectAppDataFolder ? "." :
|
||||
Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), productName);
|
||||
#if DEBUG
|
||||
//avoid db path conflict with release version
|
||||
//appDataFolder = ".";
|
||||
appDataFolder = AppDomain.CurrentDomain.BaseDirectory;
|
||||
#endif
|
||||
|
||||
ReadDataDumpSafe();
|
||||
curDisplayKey = GetDisplayKey();
|
||||
CaptureNewDisplayConfig(curDisplayKey);
|
||||
|
||||
//RestoreSnapshot(id);
|
||||
restoringSnapshot = true;
|
||||
snapshotId = id;
|
||||
restoringFromMem = true;
|
||||
RestoreApplicationsOnCurrentDisplays(curDisplayKey, IntPtr.Zero, DateTime.Now);
|
||||
}
|
||||
|
||||
public bool Start(bool auto_restore_from_db, bool auto_restore_last_capture_at_startup)
|
||||
{
|
||||
process = Process.GetCurrentProcess();
|
||||
|
@ -2971,7 +2993,8 @@ namespace PersistentWindows.Common
|
|||
//vacantDeskWindow = User32.FindWindowEx(vacantDeskWindow, IntPtr.Zero, "SHELLDLL_DefView", "");
|
||||
//vacantDeskWindow = User32.FindWindowEx(vacantDeskWindow, IntPtr.Zero, "SysListView32", "FolderView");
|
||||
//show icon on taskbar
|
||||
hideRestoreTip();
|
||||
if (hideRestoreTip != null)
|
||||
hideRestoreTip();
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue