private void SaveWindowSize(Window wnd) { var info = new NativeMethods.WINDOWINFO(); info.cbSize = (uint)Marshal.SizeOf(info); NativeMethods.GetWindowInfo((new WindowInteropHelper(wnd)).Handle, ref info); savedWidth = info.rcWindow.Right - info.rcWindow.Left; savedHeight = info.rcWindow.Bottom - info.rcWindow.Top; }