Пример #1
0
 internal static extern bool GetWindowPlacement(IntPtr hWnd, out WINDOWPLACEMENT lpwndpl);
Пример #2
0
 internal static extern bool GetWindowPlacement(IntPtr hWnd, out WINDOWPLACEMENT lpwndpl);
Пример #3
0
 protected virtual void SaveWindowState()
 {
     if (_settings == null)
     {
         return;
     }
     var hwnd = new WindowInteropHelper(_window).Handle;
     var wp = new WINDOWPLACEMENT();
     wp.length = Marshal.SizeOf(wp);
     UnsafeNativeMethods.GetWindowPlacement(hwnd, ref wp);
     // check for saveable values
     if (wp.showCmd != (int)Constants.ShowWindowCommands.SW_HIDE && wp.length > 0)
     {
         if (wp.showCmd == (int)Constants.ShowWindowCommands.SW_NORMAL)
         {
             RECT rect;
             if (UnsafeNativeMethods.GetWindowRect(hwnd, out rect))
             {
                 wp.normalPosition = rect;
             }
         }
         if (!wp.normalPosition.IsEmpty)
         {
             _settings.Placement = wp;
         }
     }
     _settings.Save();
 }
Пример #4
0
 internal static extern bool SetWindowPlacement(IntPtr hWnd, [In] ref WINDOWPLACEMENT lpwndpl);