Beispiel #1
0
        /// <summary>
        /// Create a cursor using the Native win32 call.
        /// Note : When we use overloaded constructor of SWF.Cursor(Stream/String) to create a
        ///        cursor for an animated cursor, it throws bad image file exception.
        ///        Hence, we need to use WIN32 API LoadCursorFromFile
        /// </summary>
        /// <param name="fileName">cursor file name</param>
        /// <returns></returns>
        private Cursor CreateCursor(String fileName)
        {
            IntPtr hCursor = NativeWindowCommon.LoadCursorFromFile(fileName);

            if (!IntPtr.Zero.Equals(hCursor))
            {
                return(new Cursor(hCursor));
            }
            else
            {
                throw new Exception();
            }
        }