예제 #1
0
 public static extern bool GetCursorInfo(out CURSORINFO pci);
예제 #2
0
 public static extern bool GetCursorInfo(out CURSORINFO pci);
예제 #3
0
파일: SUIImage.cs 프로젝트: a19284/SmartUI
        public static SUIBitmap GetCursorImage(ref int x, ref int y)
        {
            Bitmap bmp;
            IntPtr hicon;
            CURSORINFO ci = new CURSORINFO();
            ICONINFO icInfo;
            ci.cbSize = Marshal.SizeOf(ci);
            if (SUIWinAPIs.GetCursorInfo(out ci))
            {
                if (ci.flags == SUIMessage.CURSOR_SHOWING)
                {
                    hicon = SUIWinAPIs.CopyIcon(ci.hCursor);
                    if (SUIWinAPIs.GetIconInfo(hicon, out icInfo))
                    {
                        x = ci.ptScreenPos.X - ((int)icInfo.xHotspot);
                        y = ci.ptScreenPos.Y - ((int)icInfo.yHotspot);
                        Icon ic = Icon.FromHandle(hicon);
                        bmp = ic.ToBitmap();

                        return new SUIBitmap(bmp, null);
                    }
                }
            }
            return null;

        }