/// <summary> /// Gets top-level windows. /// </summary> /// <returns>Array containing window handles as <b>wnd</b>.</returns> /// <param name="onlyVisible"> /// Need only visible windows. /// Note: this function does not check whether windows are cloaked, as it is rather slow. Use <see cref="IsCloaked"/> if need. /// </param> /// <param name="sortFirstVisible"> /// Place hidden windows at the end of the array. /// Not used when <i>onlyVisible</i> is true.</param> /// <remarks> /// Calls API <msdn>EnumWindows</msdn>. /// Although undocumented, the API retrieves most windows as in the Z order, however places IDE windows (hidden) at the end. See also: <see cref="allWindowsZorder"/>; /// <note>The array can be bigger than you expect, because there are many invisible windows, tooltips, etc. See also <see cref="mainWindows"/>.</note> /// Skips message-only windows; use <see cref="findFast"/> if need. /// On Windows 8 and later may skip Windows Store app Metro-style windows (on Windows 10 few such windows exist). It happens if this program does not have disableWindowFiltering true in its manifest and is not uiAccess; to find such windows you can use <see cref="findFast"/>. /// Tip: To get top-level and child windows in single array: <c>var a = wnd.getwnd.root.Get.Children();</c>. /// </remarks> /// <seealso cref="Children"/> /// <seealso cref="findAll"/> public static wnd[] allWindows(bool onlyVisible = false, bool sortFirstVisible = false) { return(Internal_.EnumWindows(Internal_.EnumAPI.EnumWindows, onlyVisible, sortFirstVisible)); }
/// <summary> /// Gets child controls, including all descendants. /// Returns array containing 0 or more control handles as AWnd. /// </summary> /// <param name="onlyVisible">Need only visible controls.</param> /// <param name="sortFirstVisible">Place all array elements of hidden controls at the end of the array.</param> /// <param name="directChild">Need only direct children, not all descendants.</param> /// <exception cref="AuWndException">This variable is invalid (window not found, closed, etc).</exception> /// <remarks> /// Calls API <msdn>EnumChildWindows</msdn>. /// </remarks> /// <seealso cref="ChildAll"/> public AWnd[] Children(bool onlyVisible = false, bool sortFirstVisible = false, bool directChild = false) { _w.ThrowIfInvalid(); return(Internal_.EnumWindows(Internal_.EnumAPI.EnumChildWindows, onlyVisible, sortFirstVisible, _w, directChild)); }