Пример #1
0
 public static extern bool GetCursorPos(out POINT point);
Пример #2
0
 public static extern bool ScreenToClient(IntPtr hwnd, ref POINT point);
Пример #3
0
        public static IntPtr DescendantWindowFromCursor(IntPtr hwndParent, out POINT point)
        {
            POINT cursor;
            if (!GetCursorPos(out cursor))
            {
                point = new POINT();
                return IntPtr.Zero;
            }

            return DescendantWindowFromPoint(hwndParent, cursor, out point);
        }
Пример #4
0
        public static IntPtr DescendantWindowFromPoint(IntPtr hwndParent, POINT absPoint, out POINT relativePoint)
        {
            while (true)
            {
                relativePoint = absPoint;
                ScreenToClient(hwndParent, ref relativePoint);

                IntPtr child = ChildWindowFromPoint(hwndParent, relativePoint);
                if (child == IntPtr.Zero || child == hwndParent) return child;
                hwndParent = child;
            }
        }
Пример #5
0
 public static extern IntPtr ChildWindowFromPoint(IntPtr hwndParent, POINT point);
Пример #6
0
        public static IntPtr DescendantWindowFromPoint(IntPtr hwndParent, POINT absPoint, out POINT relativePoint)
        {
            while (true)
            {
                relativePoint = absPoint;
                ScreenToClient(hwndParent, ref relativePoint);

                IntPtr child = ChildWindowFromPoint(hwndParent, relativePoint);
                if (child == IntPtr.Zero || child == hwndParent)
                {
                    return(child);
                }
                hwndParent = child;
            }
        }
Пример #7
0
 public static extern bool ScreenToClient(IntPtr hwnd, ref POINT point);
Пример #8
0
 public static extern bool GetCursorPos(out POINT point);
Пример #9
0
 public static extern IntPtr ChildWindowFromPoint(IntPtr hwndParent, POINT point);