Custom Animated Cursor

This is a discussion on Custom Animated Cursor within the Windows Programming forums, part of the Platform Specific Boards category; Hey, i was wondering if i could use a custom animated cursor in my program. i'm 99.99% positive i can, ...

  1. #1
    Shibby willc0de4food's Avatar
    Join Date
    Mar 2005
    Location
    MI
    Posts
    378

    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
    Last edited by willc0de4food; 05-13-2005 at 01:31 AM.
    Registered Linux User #380033. Be counted: http://counter.li.org

  2. #2
    Registered User Joelito's Avatar
    Join Date
    Mar 2005
    Location
    Tijuana, BC, México
    Posts
    308
    Are you cursors in the same dir as your Resource.rc?

  3. #3
    Shibby willc0de4food's Avatar
    Join Date
    Mar 2005
    Location
    MI
    Posts
    378
    yes.
    Registered Linux User #380033. Be counted: http://counter.li.org

  4. #4
    Yes, my avatar is stolen anonytmouse's Avatar
    Join Date
    Dec 2002
    Posts
    2,544
    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.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Custom Cursor
    By C-Compiler in forum Windows Programming
    Replies: 1
    Last Post: 12-21-2008, 10:24 PM
  2. Restoring the Cursor
    By leojose in forum Windows Programming
    Replies: 8
    Last Post: 06-09-2005, 01:29 PM
  3. cursor question
    By GodLike in forum Windows Programming
    Replies: 3
    Last Post: 05-09-2002, 07:14 PM
  4. cursor remains in openGL fullscreen
    By Ken Fitlike in forum Game Programming
    Replies: 5
    Last Post: 03-14-2002, 08:52 PM
  5. Mouse in 800x600 24Bit Mode?
    By Unregistered in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 11-11-2001, 01:38 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21