473,806 Members | 2,346 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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(By Val strIdentifier As String) As Cursor
Return New
Cursor([Assembly].GetExecutingAs sembly().GetMan ifestResourceSt ream(strIdenti
fier))
End Function

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

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

An unhandled exception of type 'System.Argumen tException' 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 3897
"Bubbles Van" <bu************ ***@hotmail.com > schrieb
However, when I call GetResCursor with this:
m_BusyCursor = GetResCursor("F ileSearch.busy. ani")
and specify an animated cursor, I receive the following exception:

An unhandled exception of type 'System.Argumen tException'
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.c om/article.asp?id= 4565>

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

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
3295
by: Abdessamad Belangour | last post by:
Hi all, I want to display an animated cursor associated to the cursor property of a control. but the animated cursors (.ani files) are not supported by the Cursor class. Is there any other way to do it. Thanks!!
0
1909
by: Joe | last post by:
I want to display a loading image which is an animated gif but it doesn't move until the control is done loading. Is there anyway to do something like this?
4
7876
by: MrPickwick | last post by:
Hi there. If I place a picturebox on my form and load (at design time) an animated gif into it, it shows and animates allright. If I load my animated gifs in an Imagelist at design time and at runtime copy the image from the list into a PictureBox using "MyPictureBox.Image = MyImageList.Images(n)" it will only show the first frame and not animate at all. Does this not work at all? Are there alternatives? Thanks and regards
4
2819
by: Schorschi | last post by:
I am trying to mimic the following (which works) but Use the stock GetManifestResourceStream route. For example Public Declare Unicode Function LoadCursorFromFile Lib "USER32.DLL" Alias "LoadCursorFromFileW" (ByVal thePath As String) As IntPtr Dim theCursor As Cursor
5
10221
by: Paul Cheetham | last post by:
Hi, I have some custom colour cursors which I have added to my c# project, and set them to be compiled as "Embedded Resource" It seems impossible to load a colour cursor using the standard Cursor class, so I have had to resort to loading it using the Win32 API, and creating the cursor with - new Cursor(HCURSOR) The code I am using is shown at the bottom of this post.
3
25494
by: bdog4 | last post by:
I've seen on some php forums that they use some type of popup box that I assume is javascript to display a animated gif/flash when you do a quick edit. My popup blocker does not detect it so I leads me to believe it is javascript. Does anyone have an ideas on how I can do this or an example/tutorial? They use it on Invision Power Boards Thanks
2
2375
by: Dom | last post by:
I need to change the cursor when the mouse is hovering over certain cells in a DataViewGrid, as a visual aid for the user. But the cursor is not something found in the Cursors Class. I have a .ICO file. What is the most efficient way of doing this? Is a way to build the cursor resource right into the executable, so that it travels with the EXE? That seems to be the way other programs do it. For example, I have a resource viewer that...
0
1570
by: helraizer1 | last post by:
Hey, I have a PHP script that I made for an image based shoutbox with emoticons. The problem is that php GD doesn't support animated gifs, yet perl GD does. How would I make it so that I could copy the animated gifs via Perl onto the static image that I made with php? I've tried with php imagecreatefromgif(), which produces a static image. I also tried using the GIFAnimation class from phpclasses to make an animated gif but it returns it as...
3
1417
OuTCasT
by: OuTCasT | last post by:
Hi Guys I would like to use a preloader to load my .aspx page. Just for activity on the page so the users see that something is actually happening. I have a animated .gif loading image. I read you need to use a div that is hidden but i cant seem to get it right, the gif image is not animated when the div appears.
0
9719
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10618
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10366
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10110
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9187
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5546
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5678
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4329
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3850
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.