468,294 Members | 1,926 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,294 developers. It's quick & easy.

Loading animated cursor resource

I'm trying to load an animated cursor resource directly from the exe file.
I have added it in into the assembly and set it's build action to embedded
resource.

I have a function written as follows:

Private Function GetResCursor(ByVal strIdentifier As String) As Cursor
Return New
Cursor([Assembly].GetExecutingAssembly().GetManifestResourceStream( strIdenti
fier))
End Function

When I call the function with the following:
m_BusyCursor = GetResCursor("FileSearch.cross.cur")
everything works just fine and I'm able to change the cursor.

However, when I call GetResCursor with this:
m_BusyCursor = GetResCursor("FileSearch.busy.ani")
and specify an animated cursor, I receive the following exception:

An unhandled exception of type 'System.ArgumentException' occurred
in system.windows.forms.dll
Additional information: Invalid image format. The image file may be
corrupt.

I know the image isn't corrupt as I'm able to use this animated cursor file
under mouse properties.

Any suggestions???

Thanks

Brant
Nov 20 '05 #1
2 3507
"Bubbles Van" <bu***************@hotmail.com> schrieb
However, when I call GetResCursor with this:
m_BusyCursor = GetResCursor("FileSearch.busy.ani")
and specify an animated cursor, I receive the following exception:

An unhandled exception of type 'System.ArgumentException'
occurred
in system.windows.forms.dll
Additional information: Invalid image format. The image file
may be
corrupt.


See the docs for the Cursor class. Animated cursors are not supported.
--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #2
* "Bubbles Van" <bu***************@hotmail.com> scripsit:
I'm trying to load an animated cursor resource directly from the exe file.
I have added it in into the assembly and set it's build action to embedded
resource.


Maybe this article helps:

<http://vbaccelerator.com/article.asp?id=4565>

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Abdessamad Belangour | last post: by
4 posts views Thread by MrPickwick | last post: by
5 posts views Thread by Paul Cheetham | last post: by
3 posts views Thread by bdog4 | last post: by
2 posts views Thread by Dom | last post: by
reply views Thread by helraizer1 | last post: by
reply views Thread by Teichintx | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.