Exemplo n.º 1
0
 public static extern bool GetCursorPos(out POINT point);
Exemplo n.º 2
0
 public static extern bool ScreenToClient(IntPtr hwnd, ref POINT point);
Exemplo n.º 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);
        }
Exemplo n.º 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;
            }
        }
Exemplo n.º 5
0
 public static extern IntPtr ChildWindowFromPoint(IntPtr hwndParent, POINT point);
Exemplo n.º 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;
            }
        }
Exemplo n.º 7
0
 public static extern bool ScreenToClient(IntPtr hwnd, ref POINT point);
Exemplo n.º 8
0
 public static extern bool GetCursorPos(out POINT point);
Exemplo n.º 9
0
 public static extern IntPtr ChildWindowFromPoint(IntPtr hwndParent, POINT point);