By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,781 Members | 1,387 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,781 IT Pros & Developers. It's quick & easy.

Loading animated cursor resource

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
"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

P: n/a
* "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.