private static extern bool SetWindowPlacement(IntPtr hWnd, [In] ref WINDOWPLACEMENT lpwndpl);
private static extern bool GetWindowPlacement(IntPtr hWnd, out WINDOWPLACEMENT lpwndpl);
/// <summary> /// An extension to the Window class to set the window placement. /// </summary> /// <param name="window">The window to place.</param> /// <param name="placement">The placement of the window.</param> public static void SetPlacement(this Window window, WINDOWPLACEMENT placement) { WindowPlacement.SetPlacement(new WindowInteropHelper(window).Handle, placement); }