I have imported a file “x.ani” into Resource file Resources.resx. Now trying to load that file using ResourceManager.GetObject(“aero_busy.ani”)
Cursor.Current = (Cursor)ResourcesX.GetObject("aero_busy.ani");
but it didn’t work .. (certainly) 🙂
How can I change the current Cursor using resource object?
I haven’t found any better way than dumping to a temp file and use the Win32 load cursor from file method. The hack goes something like this (I removed a big chunk of boilerplate code for clarity, in which a temp file is written with the data from the stream). Also, all exception handling etc. was removed.
You would use this as (remember namespaces when loading embedded resources).