PersistentWindows/Ninjacrab.PersistentWindows.Solution/Ninjacrab.PersistentWindows.Common/Models/ApplicationDisplayMetrics.cs
Min Yong Kim 9409d20445 1. Modification to make the application run in the systray
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
2015-02-27 00:38:08 -05:00

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);
}
}
}