#301, add -fix_taskbar=0 command option

This commit is contained in:
Kang Yu 2024-03-18 14:42:52 -07:00
parent 2677195952
commit 84a8ac5792
4 changed files with 12 additions and 7 deletions

View file

@ -91,7 +91,6 @@ namespace PersistentWindows.Common
}
else if (e.Button == MouseButtons.Middle)
{
int i = 0;
}
User32.SetForegroundWindow(Handle);

View file

@ -97,6 +97,7 @@ namespace PersistentWindows.Common
public bool showDesktop = false; // show desktop when display changes
public int fixZorder = 1; // 1 means restore z-order only for snapshot; 2 means restore z-order for all; 0 means no z-order restore at all
public int fixZorderMethod = 5; // bit i represent restore method for pass i
public bool fixTaskBar = true;
public bool pauseAutoRestore = false;
public bool promptSessionRestore = false;
public bool redrawDesktop = false;
@ -3406,6 +3407,9 @@ namespace PersistentWindows.Common
if (IsTaskBar(hWnd))
{
if (!fixTaskBar && !restoringFromDB && !restoringSnapshot)
continue;
int taskbarMovable = (int)Registry.GetValue(@"HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced", "TaskbarSizeMove", 1);
if (taskbarMovable == 0)
{

View file

@ -10,10 +10,11 @@ namespace PersistentWindows.SystrayShell
public class HotKeyForm : Form
{
static HotKeyWindow hkwin = null;
static Thread messageLoop = null;
public static void Start()
{
Thread messageLoop = new Thread(() =>
messageLoop = new Thread(() =>
{
hkwin = new HotKeyWindow();
Application.Run(new HotKeyForm());
@ -57,10 +58,12 @@ namespace PersistentWindows.SystrayShell
base.SetVisibleCore(false);
}
public void Dispose()
~HotKeyForm()
{
messageLoop.Abort();
User32.UnregisterHotKey(this.Handle, 0);
}
}
}

View file

@ -184,6 +184,9 @@ namespace PersistentWindows.SystrayShell
case "-fix_unminimized_window=0":
fix_unminimized_window = false;
break;
case "-fix_taskbar=0":
pwp.fixTaskBar = false;
break;
case "-foreground_background_dual_position=0":
pwp.enableDualPosSwitch = false;
break;
@ -729,9 +732,5 @@ namespace PersistentWindows.SystrayShell
Log.Error(format, args);
}
public static IntPtr GetForegroundWindow()
{
return PersistentWindowProcessor.GetForegroundWindow();
}
}
}