Ejemplo n.º 1
0
        public IntPtr? CursorHandleGet(int x, int y)
        {
            var pt = new User32.POINT { x = x, y = y };

            User32.ClientToScreen(hwnd, ref pt);
            User32.SetCursorPos(pt.x, pt.y);
            Thread.Sleep(20);
            var info = new User32.CursorInfo();
            info.Size = Marshal.SizeOf(info.GetType());

            if (User32.GetCursorInfo(out info))
                return info.Handle;

            return null;
        }
Ejemplo n.º 2
0
        public IntPtr?CursorHandleGet(int x, int y)
        {
            var pt = new User32.POINT {
                x = x, y = y
            };

            User32.ClientToScreen(hwnd, ref pt);
            User32.SetCursorPos(pt.x, pt.y);
            Thread.Sleep(20);
            var info = new User32.CursorInfo();

            info.Size = Marshal.SizeOf(info.GetType());

            if (User32.GetCursorInfo(out info))
            {
                return(info.Handle);
            }

            return(null);
        }