mirror of
https://github.com/kangyu-california/PersistentWindows.git
synced 2025-05-11 21:15:38 +02:00
2. Abstracting processor and winapi logic into common dll and entry points into separate dlls 3. Adding icons 4. Switching build platform to AnyCPU. Seems to work on x64, don't have a x86 platform to test on
31 lines
1.2 KiB
C#
31 lines
1.2 KiB
C#
using System;
|
|
using Ninjacrab.PersistentWindows.Common.WinApiBridge;
|
|
|
|
namespace Ninjacrab.PersistentWindows.Common.Models
|
|
{
|
|
public class ApplicationDisplayMetrics
|
|
{
|
|
public IntPtr HWnd { get; set; }
|
|
public int ProcessId { get; set; }
|
|
public string ApplicationName { get; set; }
|
|
public WindowPlacement WindowPlacement { get; set; }
|
|
|
|
public string Key
|
|
{
|
|
get { return string.Format("{0}-{1}", HWnd.ToInt64(), ApplicationName); }
|
|
}
|
|
|
|
public bool EqualPlacement(ApplicationDisplayMetrics other)
|
|
{
|
|
return this.WindowPlacement.NormalPosition.Left == other.WindowPlacement.NormalPosition.Left
|
|
&& this.WindowPlacement.NormalPosition.Top == other.WindowPlacement.NormalPosition.Top
|
|
&& this.WindowPlacement.NormalPosition.Width == other.WindowPlacement.NormalPosition.Width
|
|
&& this.WindowPlacement.NormalPosition.Height == other.WindowPlacement.NormalPosition.Height;
|
|
}
|
|
|
|
public override string ToString()
|
|
{
|
|
return string.Format("{0}.{1} {2}", ProcessId, HWnd.ToInt64(), ApplicationName);
|
|
}
|
|
}
|
|
}
|