/// <summary>Retrieves the show state and the restored, minimized, and maximized positions of the specified window.</summary> public static WINDOWPLACEMENT GetWindowPlacement (this Window window) { var place = new WINDOWPLACEMENT { Length = Marshal.SizeOf(typeof(WINDOWPLACEMENT)) }; if (GetWindowPlacement(GetHandle(window), ref place)) return place; else throw new Win32Exception(); }
public static void SetPlacement (Window d, WINDOWPLACEMENT value) { d.SetValue(PlacementProperty, value); }
/// <summary>Sets the show state and the restored, minimized, and maximized positions of the specified window.</summary> public static void SetWindowPlacement (this Window window, WINDOWPLACEMENT place) { place.Length = Marshal.SizeOf(typeof(WINDOWPLACEMENT)); if (!SetWindowPlacement(GetHandle(window), ref place)) throw new Win32Exception(); }
private static extern bool GetWindowPlacement (IntPtr hWnd, ref WINDOWPLACEMENT lpwndpl);