/// <summary>
        /// Go through the list of all element chidren and exclude them from the list of
        /// visible/clickable rectangles.
        /// The element children may be listed in any order. A check on all of them must
        /// be performed. There is no easy way out.
        /// </summary>
        /// <param name="fragment"></param>
        /// <param name="alIn"></param>
        /// <param name="alOut"></param>
        internal static void ExcludeChildren(ProxyFragment fragment, ArrayList alIn, ArrayList alOut)
        {
            // First go through all the children to exclude whatever is on top
            for (ProxySimple simple = fragment.GetFirstChild(); simple != null; simple = fragment.GetNextSibling(simple))
            {
                // The exclusion for hwnd children is done by the GetPoint routine
                if (simple is ProxyHwnd)
                {
                    continue;
                }

                // Copy the output bits
                alIn.Clear();
                alIn.AddRange(alOut);

                NativeMethods.Win32Rect rc = new NativeMethods.Win32Rect(simple.BoundingRectangle);
                CPRect rcp = new CPRect(ref rc, false);

                ClickablePoint.SplitRect(alIn, ref rcp, alOut, true);

                // recurse on the children
                if (simple is ProxyFragment)
                {
                    ExcludeChildren((ProxyFragment)simple, alIn, alOut);
                }
            }
        }
        // ------------------------------------------------------
        //
        // Private Methods
        //
        // ------------------------------------------------------

        #region Private Methods

        private static bool ClickableInRect(IntPtr hwnd, ref NativeMethods.Win32Point pt, bool fRiAsInsideRect, ArrayList alIn, ArrayList alOut)
        {
            if (!SafeNativeMethods.IsWindowVisible(hwnd))
            {
                return(fRiAsInsideRect);
            }

            // Get the window rect. If this window has a width and it is effectivly invisible
            NativeMethods.Win32Rect rc = new NativeMethods.Win32Rect();

            if (!Misc.GetWindowRect(hwnd, ref rc))
            {
                return(fRiAsInsideRect);
            }

            if ((rc.right - rc.left) <= 0 || (rc.bottom - rc.top) <= 0)
            {
                return(fRiAsInsideRect);
            }

            // Try for transparency...
            if (fRiAsInsideRect)
            {
                int x = (rc.right + rc.left) / 2;
                int y = (rc.top + rc.bottom) / 2;

                try
                {
                    int lr = Misc.ProxySendMessageInt(hwnd, NativeMethods.WM_NCHITTEST, IntPtr.Zero, NativeMethods.Util.MAKELPARAM(x, y));

                    if (lr == NativeMethods.HTTRANSPARENT)
                    {
                        return(true);
                    }
                }
// PRESHARP: Warning - Catch statements should not have empty bodies
#pragma warning disable 6502
                catch (TimeoutException)
                {
                    // Ignore this timeout error.  Avalon HwndWrappers have a problem with this WM_NCHITTEST call sometimes.
                }
#pragma warning restore 6502
            }

            // Copy the output bits
            alIn.Clear();
            alIn.AddRange(alOut);

            CPRect rcp = new CPRect(ref rc, false);

            ClickablePoint.SplitRect(alIn, ref rcp, alOut, fRiAsInsideRect);
            if (!GetClickablePoint(alOut, out pt.x, out pt.y))
            {
                return(false);
            }

            return(true);
        }
        //------------------------------------------------------
        //
        //  Internal Methods
        //
        //------------------------------------------------------

        #region Internal Methods

        // Returns the clickable point on the element
        // In the case when clickable point is obtained - method returns true
        // In the case when clickable point cannot be obtained - method returns false
        internal bool GetClickablePoint(out NativeMethods.Win32Point pt, bool fClipClientRect)
        {
            NativeMethods.Win32Rect rcItem = new NativeMethods.Win32Rect(BoundingRectangle);

            // Intersect the bounding Rectangle with the client rectangle for framents
            // and simple items - use the override flag (used mostly for the non client area
            if (fClipClientRect && !_fNonClientAreaElement)
            {
                NativeMethods.Win32Rect rcOutside = new NativeMethods.Win32Rect();

                Misc.GetClientRectInScreenCoordinates(_hwnd, ref rcOutside);

                if (!Misc.IntersectRect(ref rcItem, ref rcOutside, ref rcItem))
                {
                    pt.x = pt.y = 0;
                    return(false);
                }
            }

            ArrayList alIn  = new ArrayList(100);
            ArrayList alOut = new ArrayList(100);

            // Get the mid point to start with
            pt.x = (rcItem.right - 1 + rcItem.left) / 2;
            pt.y = (rcItem.bottom - 1 + rcItem.top) / 2;
            alOut.Add(new ClickablePoint.CPRect(ref rcItem, true));

            // First go through all the children to exclude whatever is on top
            ProxyFragment proxyFrag = this as ProxyFragment;

            if (proxyFrag != null)
            {
                ClickablePoint.ExcludeChildren(proxyFrag, alIn, alOut);
            }

            return(ClickablePoint.GetPoint(_hwnd, alIn, alOut, ref pt));
        }