public static RECT GetWindowRectangle(Window window) { RECT rect; GetWindowRect((new WindowInteropHelper(window)).Handle, out rect); return rect; }