public static void SetWpfWindowPlacement(Window window, WindowPlacementStruct wpStruct) { if (window == null) { throw new ArgumentNullException(nameof(window)); } SetWindowPlacement(new WindowInteropHelper(window).Handle, ref wpStruct); }
public static WindowPlacementStruct GetWpfWindowPlacement(Window window) { if (window == null) { throw new ArgumentNullException(nameof(window)); } WindowPlacementStruct placement = new WindowPlacementStruct(); GetWindowPlacement(new WindowInteropHelper(window).Handle, out placement); return(placement); }
private static extern bool GetWindowPlacement(IntPtr hWnd, out WindowPlacementStruct lpwndpl);
private static extern bool SetWindowPlacement(IntPtr hWnd, [In] ref WindowPlacementStruct lpwndpl);