示例#1
0
        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();
        }
示例#2
0
 public static extern bool GetWindowPlacement(IntPtr hWnd, out WINDOWPLACEMENT lpwndpl);