fix z-order restore failure for foreground window

This commit is contained in:
Kang Yu 2020-11-21 21:59:08 -08:00
parent d8fc91ba30
commit c6d81deb6a
2 changed files with 2 additions and 2 deletions

View file

@ -1288,13 +1288,12 @@ namespace Ninjacrab.PersistentWindows.Common
return 0;
}
/*
if (IsTaskBar(prevWindow))
{
Log.Error("avoid restore under taskbar for window {0}", GetWindowTitle(hWnd));
User32.ShowWindow(hWnd, User32.SW_SHOW);
return 0; // issue 21, avoid restore to top z-order
}
*/
bool ok = User32.SetWindowPos(
hWnd,

View file

@ -246,6 +246,7 @@ namespace Ninjacrab.PersistentWindows.Common.WinApiBridge
public static extern bool ShowWindowAsync(IntPtr hWnd, int cmd);
public const int SW_SHOWMINNOACTIVE = 7;
public const int SW_SHOW = 5;
[DllImport("user32.dll", SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]