Estrayk
January 23rd, 2008, 05:51 PM
Hey, I want to ask how to load a .ani cursor from resources and display it on my dialog.
I can load a normal cursor (.cur) and display it without problems, however when I try with
the animated cursor it just disappears.
With this I can load a normal cursor
HCURSOR cur = LoadCursor(MyInstance, MAKEINTRESOURCE(IDR_CUR1));
SetClassLong(hwnd, GCL_HCURSOR, (LONG)cur);
Trying to do that with a .ani file just makes the cursor invisible.
I have tried to load it with LoadImage() instead, and that does not work either
HCURSOR cur = (HCURSOR)LoadImage(MyInstance, MAKEINTRESOURCE(IDR_CUR1), IMAGE_CURSOR, 0, 0, LR_DEFAULTSIZE);
Finally I got it working by using:
HCURSOR cur = LoadCursorFromFile("arrow.ani");
But that is not how I want it, I do not wish to have anything besides a .exe for my final product, how can I do this? I have searched the forum several times and I cant find a answer. msdn points me to use LoadImage, but I cant get it to work. Please help
I can load a normal cursor (.cur) and display it without problems, however when I try with
the animated cursor it just disappears.
With this I can load a normal cursor
HCURSOR cur = LoadCursor(MyInstance, MAKEINTRESOURCE(IDR_CUR1));
SetClassLong(hwnd, GCL_HCURSOR, (LONG)cur);
Trying to do that with a .ani file just makes the cursor invisible.
I have tried to load it with LoadImage() instead, and that does not work either
HCURSOR cur = (HCURSOR)LoadImage(MyInstance, MAKEINTRESOURCE(IDR_CUR1), IMAGE_CURSOR, 0, 0, LR_DEFAULTSIZE);
Finally I got it working by using:
HCURSOR cur = LoadCursorFromFile("arrow.ani");
But that is not how I want it, I do not wish to have anything besides a .exe for my final product, how can I do this? I have searched the forum several times and I cant find a answer. msdn points me to use LoadImage, but I cant get it to work. Please help