Initial commit

This commit is contained in:
2023-04-07 17:20:52 -04:00
commit 622aefa7fc
10 changed files with 1152 additions and 0 deletions

27
WindowInformation.cs Normal file
View File

@@ -0,0 +1,27 @@
using System.Drawing;
namespace ChrisKaczor.Wpf.Windows;
public class WindowInformation
{
private nint Handle { get; }
public Rectangle Location { get; }
public WindowInformation(nint handle)
{
Handle = handle;
var windowPlacement = new PInvoke.WindowPlacement();
PInvoke.GetWindowPlacement(Handle, ref windowPlacement);
var normalPosition = windowPlacement.NormalPosition;
Location = new Rectangle(normalPosition.X, normalPosition.Y, normalPosition.Width, normalPosition.Height);
}
public WindowInformation(nint handle, Rectangle location)
{
Handle = handle;
Location = location;
}
}