mirror of
https://github.com/kangyu-california/PersistentWindows.git
synced 2025-05-12 13:35:39 +02:00
fix another issue related to #239, reject unexpected position change of minimized window
This commit is contained in:
parent
ce4470420a
commit
10facd158d
1 changed files with 6 additions and 18 deletions
|
@ -2112,24 +2112,6 @@ namespace PersistentWindows.Common
|
||||||
if (string.IsNullOrEmpty(GetWindowTitle(hwnd)))
|
if (string.IsNullOrEmpty(GetWindowTitle(hwnd)))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// workaround runtime overflow exception in release build
|
|
||||||
//SystemWindow window = new SystemWindow(hwnd);
|
|
||||||
//WindowStyleFlags style = window.Style;
|
|
||||||
|
|
||||||
/*
|
|
||||||
long style = User32.GetWindowLong(hwnd, User32.GWL_STYLE);
|
|
||||||
if ((style & (long)WindowStyleFlags.MINIMIZEBOX) == 0L)
|
|
||||||
continue;
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* full screen app such as mstsc may not have maximize box */
|
|
||||||
/*
|
|
||||||
if ((style & (long)WindowStyleFlags.MAXIMIZEBOX) == 0L)
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
result.Add(hwnd);
|
result.Add(hwnd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2350,6 +2332,12 @@ namespace PersistentWindows.Common
|
||||||
}
|
}
|
||||||
else if (curDisplayMetrics.IsMinimized && prevDisplayMetrics.IsMinimized)
|
else if (curDisplayMetrics.IsMinimized && prevDisplayMetrics.IsMinimized)
|
||||||
{
|
{
|
||||||
|
if (sessionActive)
|
||||||
|
{
|
||||||
|
//Log.Error("reject minimized window move {0}", GetWindowTitle(hwnd));
|
||||||
|
return false; //do not capture unexpected minimized window movement (by the app or OS)
|
||||||
|
}
|
||||||
|
|
||||||
//remain minimized
|
//remain minimized
|
||||||
if (prevDisplayMetrics.IsFullScreen)
|
if (prevDisplayMetrics.IsFullScreen)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue