mirror of
https://github.com/kangyu-california/PersistentWindows.git
synced 2025-05-11 04:55:39 +02:00
#356, matching window title has higher priority than matching window position when inherit from killed window
This commit is contained in:
parent
c8575c1b03
commit
df594f6045
1 changed files with 7 additions and 3 deletions
|
@ -1349,17 +1349,21 @@ namespace PersistentWindows.Common
|
||||||
if (!procName.Equals(appPos.ProcessName))
|
if (!procName.Equals(appPos.ProcessName))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// match position first
|
|
||||||
RECT r = appPos.ScreenPosition;
|
RECT r = appPos.ScreenPosition;
|
||||||
RECT rect = new RECT();
|
RECT rect = new RECT();
|
||||||
User32.GetWindowRect(hwnd, ref rect);
|
User32.GetWindowRect(hwnd, ref rect);
|
||||||
if (rect.Equals(r))
|
// find exact match first
|
||||||
|
if (rect.Equals(r) && title.Equals(appPos.Title))
|
||||||
return kid;
|
return kid;
|
||||||
|
|
||||||
// lastly match title
|
// match title second
|
||||||
if (title.Equals(appPos.Title))
|
if (title.Equals(appPos.Title))
|
||||||
return kid;
|
return kid;
|
||||||
|
|
||||||
|
// match position last
|
||||||
|
if (rect.Equals(r))
|
||||||
|
return kid;
|
||||||
|
|
||||||
if (dflt_kid == IntPtr.Zero)
|
if (dflt_kid == IntPtr.Zero)
|
||||||
dflt_kid = kid;
|
dflt_kid = kid;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue