WindowIsNotHung() public static method

public static WindowIsNotHung ( IntPtr hWnd ) : bool
hWnd System.IntPtr
return bool
Esempio n. 1
0
 void ILayout.WindowCreated(Window window)
 {
     if (workspace.IsWorkspaceVisible || window.WorkspacesCount == 1)
     {
         if (NativeMethods.IsZoomed(window.hWnd) && Utilities.WindowIsNotHung(window))
         {
             // restore if maximized - should not use SW_RESTORE as it activates the window
             NativeMethods.ShowWindow(window.hWnd, NativeMethods.SW.SW_SHOWNOACTIVATE);
             System.Threading.Thread.Sleep(NativeMethods.minimizeRestoreDelay);
         }
         if (workspace.IsWorkspaceVisible)
         {
             Reposition();
         }
     }
 }
Esempio n. 2
0
        void ILayout.Reposition()
        {
            // restore any maximized windows - should not use SW_RESTORE as it activates the window
            var hasMaximized = false;

            foreach (var window in workspace.GetLayoutManagedWindows().
                     Where(w => NativeMethods.IsZoomed(w.hWnd) && Utilities.WindowIsNotHung(w)))
            {
                hasMaximized = true;
                NativeMethods.ShowWindow(window.hWnd, NativeMethods.SW.SW_SHOWNOACTIVATE);
            }
            if (hasMaximized)
            {
                System.Threading.Thread.Sleep(NativeMethods.minimizeRestoreDelay);
            }

            this.windows = workspace.GetLayoutManagedWindows();
            Reposition();
        }