-
Custom Animated Cursor
Hey, i was wondering if i could use a custom animated cursor in my program. i'm 99.99% positive i can, so how? lol i've tried making the cursor .cur and .ani and i've also tried this code:
Code:
wc.hCursor = LoadCursor(hInstance, MAKEINTRESOURCE(IDC_SHIBBY_CUR));
and
wc.hCursor = LoadCursor(GetModuleHandle(NULL), MAKEINTRESOURCE(IDC_SHIBBY_CUR));
code in .rc file:
Code:
IDC_CUSTOMCUR CURSOR "drip.(cur/ani)" (respectively)
code in header:
Code:
#define IDC_CUSTOMCUR 1001
and my compiler spits out the error "cursor file 'drip.ani' does not contain cursor data" but yet, i'm using the cursor right now in windows as my "normal" cursor. thanks
-
Are you cursors in the same dir as your Resource.rc?
-
-
I'm guessing you found a bug in your resource compiler. A search on the error text brings up this code:
Code:
/* A cursor file is basically an icon file. The start of the file
is a three word structure. The first word is ignored. The
second word is the type of data. The third word is the number of
entries. */
get_word (e, real_filename);
type = get_word (e, real_filename);
count = get_word (e, real_filename);
if (type != 2)
fatal (_("cursor file `%s' does not contain cursor data"), real_filename);
Possibly, the type field for an animated cursor is not 2. You could check this with a hex editor, and if it proves to be the problem, report it as a bug.
In the meantime, you could bypass the resource compiler by using the LoadCursorFromFile function.