Ejemplo n.º 1
0
        private void PreWinEventProc(int eventId, IntPtr hwnd, int idObject, int idChild, uint eventTime)
        {
            // Ignore events from the UIA->MSAA bridge: these are recognizable as having
            // >0 idObject, and the target HWND having a UIA impl.
            if (idObject > 0)
            {
                if (UiaCoreApi.UiaHasServerSideProvider(hwnd))
                {
                    // Bridge event - ignore it.
                    return;
                }
            }

            // 0 is used as a marker value elsewhere, so bump up to 1
            if (eventTime == 0)
            {
                eventTime = 1;
            }
            WinEventProc(eventId, hwnd, idObject, idChild, eventTime);
        }