Clean up other window checking for snapping windows

This commit is contained in:
2014-05-06 10:19:18 -04:00
parent d7bfc74b8d
commit 6ecb265755
3 changed files with 40 additions and 5 deletions

View File

@@ -0,0 +1,30 @@
using Common.Native;
using System;
using System.Drawing;
namespace Common.Wpf.Windows
{
public class WindowInformation
{
public IntPtr Handle { get; private set; }
public Rectangle Location { get; private set; }
public WindowInformation(IntPtr handle)
{
Handle = handle;
var windowPlacement = new Structures.WindowPlacement();
Functions.User32.GetWindowPlacement(Handle, ref windowPlacement);
var normalPosition = windowPlacement.NormalPosition;
Location = new Rectangle(normalPosition.X, normalPosition.Y, normalPosition.Width, normalPosition.Height);
}
public WindowInformation(IntPtr handle, Rectangle location)
{
Handle = handle;
Location = location;
}
}
}