// proper cascade = cascade from top right to bottom left - // keep right edge at right margin and bottom edge at bottom margin // left edge to left margin max internal void RepositionWindows() { RevitWindow active = null; foreach (RevitWindow rw in ChildWindows) { if (rw.IsActive) { active = rw; } else if (rw.IsCurrDoc || rw.IsNonCurrDoc) { SetWindowPos(rw.Handle, HWND.Bottom, rw.Proposed.X, rw.Proposed.Y, rw.Proposed.Width, rw.Proposed.Height, SetWindowPosFlags.SWP_SHOWWINDOW | SetWindowPosFlags.SWP_NOACTIVATE); } else if (rw.IsMinimized) { SetWindowPos(rw.Handle, HWND.Bottom, rw.Proposed.X, rw.Proposed.Y, rw.Proposed.Width, rw.Proposed.Height, SetWindowPosFlags.SWP_SHOWWINDOW | SetWindowPosFlags.SWP_NOACTIVATE | SetWindowPosFlags.SWP_NOSIZE); } } SetWindowPos(active.Handle, HWND.Top, active.Proposed.X, active.Proposed.Y, active.Proposed.Width, active.Proposed.Height, SetWindowPosFlags.SWP_SHOWWINDOW | SetWindowPosFlags.SWP_NOACTIVATE); }
internal static bool GetRevitChildWindows(IntPtr parent) { RevitWindow.ResetRevitWindows(); List <IntPtr> children = GetChildWindows(parent); IList <View> views = GetRevitChildViews(Uidoc); bool activeSet = false; if (children == null || children.Count == 0) { return(false); } string currDoc = Doc.Title.ToLower(); foreach (IntPtr child in children) { WINDOWINFO wi = new WINDOWINFO(true); GetWindowInfo(child, ref wi); if ((wi.dwExStyle & (uint)WinStyleEx.WS_EX_MDICHILD) == 0) { continue; } // got a good window - store it for later // create the revit window data RevitWindow rw = new RevitWindow(child, NewRectangle(wi.rcWindow), currDoc); RevitWindow.ChildWindows.Add(rw); // no maximized windows allowed if (IsZoomed(child)) { ShowWindow(child, ShowWinCmds.SW_RESTORE); } } return(true); }
// 10 internal static void ListChildIsCurr(RevitWindow rw) { logMsgln(" is curr doc| " + rw.IsCurrDoc); }
// 12 internal static void ListChildIsCurrNonSel(RevitWindow rw) { logMsgln(" is curr non sel| " + rw.IsCurrDocNonSeleced); }
// 8 internal static void ListChildCurrRect(RevitWindow rw) { logMsgln(" rect current| " + ListRect(rw.Current)); }
// 9 internal static void ListChildPropRect(RevitWindow rw) { logMsgln(" rect proposed| " + ListRect(rw.Proposed)); }
// 6 internal static void ListChildIsMin(RevitWindow rw) { logMsgln(" is minimized| " + rw.IsMinimized); }
// 7 internal static void ListChildIsActive(RevitWindow rw) { logMsgln(" is active| " + rw.IsActive); }
// 5 internal static void ListChildViewType(RevitWindow rw) { logMsgln(" child ViewType| " + rw.ViewType + " viewtype name| " + (ViewType)rw.ViewType); }
// 4 internal static void ListChildWinStatus(RevitWindow rw) { logMsgln(" window status| " + Enum.GetName(typeof(WindowStatus), rw.WinStatus)); }
// 3 internal static void ListChildSeq(RevitWindow rw) { logMsgln(" child sequence| " + rw.Sequence); }
// 2 internal static void ListChildHandle(RevitWindow rw) { logMsgln(" child handle| " + rw.Handle); }
// 1 internal static void ListChildTitle(RevitWindow rw) { logMsgln(" child title| " + rw.WindowTitle); }