示例#1
0
        public static string GetCursorShape()
        {
            string result;

            try
            {
                WindowsAPI.CURSORINFO cURSORINFO = default(WindowsAPI.CURSORINFO);
                cURSORINFO.cbSize = Marshal.SizeOf(cURSORINFO);
                WindowsAPI.GetCursorInfo(out cURSORINFO);
                if (cURSORINFO.flags == 1)
                {
                    result = new Cursor(cURSORINFO.hCursor).ToString();
                }
                else
                {
                    result = "(Hidden)";
                }
            }
            catch (Exception)
            {
                result = "(Failure)";
            }
            return(result);
        }