Пример #1
0
        //------------------------------------------------------
        //
        //  Interface IRawElementProviderHwndOverride
        //
        //------------------------------------------------------
        IRawElementProviderSimple IRawElementProviderHwndOverride.GetOverrideProviderForHwnd(IntPtr hwnd)
        {
            // return the appropriate placeholder for the given hwnd...
            // loop over all the band to find it.

            // Only [....] StatusBars can have children.
            if (_acc != null)
            {
                Accessible accChild  = _acc.FirstChild;
                IntPtr     hwndChild = IntPtr.Zero;

                for (int i = 0; accChild != null; i++, accChild = accChild.NextSibling(_acc))
                {
                    hwndChild = accChild.Window;
                    if (hwndChild == IntPtr.Zero)
                    {
                        hwndChild = GetChildHwnd(_hwnd, accChild.Location);
                    }
                    if (hwndChild == hwnd)
                    {
                        return(new WindowsStatusBarPaneChildOverrideProxy(hwnd, this, i));
                    }
                }
            }

            return(null);
        }