I have an animated Cursor file (*.ani) in the resources and want to show it as a cursor in my application. How can I load it from the resources?
I looked up in the Inter
Embed the ani file as a resource and use windows functions CreateIconFromResource to create it and DestroyIcon when done.
IntPtr hCursor;
try
{
hCursor = CreateIconFromResource(resource, (uint)resource.Length, false, 0x00030000);
this.Cursor = new Cursor(hCursor);
...
}
finally
{
this.Cursor = Cursors.Normal;
DestroyIcon(hCursor);
}