protected override void OnClosing(CancelEventArgs e) { base.OnClosing(e); // persist the window placement details to the user settings. WINDOWPLACEMENT wp = new WINDOWPLACEMENT(); IntPtr hwnd = new WindowInteropHelper(this).Handle; Win32.GetWindowPlacement(hwnd, out wp); Properties.Settings.Default.MainWindowPlacement = wp; Properties.Settings.Default.Save(); }
public static extern bool GetWindowPlacement(IntPtr hWnd, out WINDOWPLACEMENT lpwndpl);