Changing cursor VC++

This is a discussion on Changing cursor VC++ within the Windows Programming forums, part of the Platform Specific Boards category; Hi everyone. I know the "LoadCursor"/"SetCursor" stuff, thats not my problem. My problem is that i want to use a ...

  1. #1
    Politics&Cpp geek Da-Nuka's Avatar
    Join Date
    Oct 2004
    Posts
    104

    Changing cursor VC++

    Hi everyone.
    I know the "LoadCursor"/"SetCursor" stuff, thats not my problem.
    My problem is that i want to use a 16bit 32X32 cursor.
    When i makes that in VC++ RC-editor, the editor makes the 2-bit curosor default for the program!

    How to make the 16bit default instead of the 2bit?

  2. #2
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,854
    CreateCursor() and MSVC use a device-dependent monochrome bitmap for cursors so will always default back (same as toolbar images are 16bit in MFC)

    Have you tried using LoadImage(), that is a HBITMAP cast to a HCURSOR?

    Something like

    hCursor = SetCursor( (HCURSOR) LoadImage(.........) );
    "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
    Friedrich Nietzsche

    "I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
    George Best

    "If you are going through hell....keep going."
    Winston Churchill

  3. #3
    Software Developer jverkoey's Avatar
    Join Date
    Feb 2003
    Location
    University of Waterloo
    Posts
    1,903
    To create a 16 bit cursor in the resource editor, you need to click a button (posted below) and then hit Custom... and make sure the colors are 16, and the size is what you want, then hit ok and you're set to go.
    Attached Images Attached Images  

  4. #4
    Politics&Cpp geek Da-Nuka's Avatar
    Join Date
    Oct 2004
    Posts
    104
    yes, i know that, but the monochrome-bitmap will still be default..

  5. #5
    Software Developer jverkoey's Avatar
    Join Date
    Feb 2003
    Location
    University of Waterloo
    Posts
    1,903
    Hrrm....? Do you mean the defaut color setting in visual studio? Because if you draw a 16 bit cursor, and load it, it will be a 16 bit cursor.

  6. #6
    Politics&Cpp geek Da-Nuka's Avatar
    Join Date
    Oct 2004
    Posts
    104
    Yes, thats true.
    But when im making a Cursor with Visual Studio, the cursor starts out with a monochrome bitmap, which is used as default, EVEN if i put a 16bits bitmap on it too.

  7. #7
    Registered User
    Join Date
    Feb 2005
    Posts
    1
    Changing to 16 bits bitmap.
    You can go to \res directory and physically delete the cursor and copy the 16bit colored cursor (download from web) with same name and try to open one curson in VC++ editor. This should work

  8. #8
    Sweet
    Join Date
    Aug 2002
    Location
    Tucson, Arizona
    Posts
    1,801
    Watch bumping old threads we tend to get cranky about that .
    Woop?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Changing errno - legal?
    By EVOEx in forum C Programming
    Replies: 6
    Last Post: 02-27-2009, 11:56 AM
  2. Changing windows without changing?
    By Lionmane in forum Windows Programming
    Replies: 7
    Last Post: 10-19-2005, 11:41 AM
  3. [C++/WinAPI] Changing bitmap contrast
    By jagi in forum Windows Programming
    Replies: 0
    Last Post: 03-27-2005, 02:51 PM
  4. changing file formats
    By darfader in forum C Programming
    Replies: 3
    Last Post: 09-26-2003, 02:13 AM
  5. Changing the pallete in allegro?
    By Brian in forum Game Programming
    Replies: 1
    Last Post: 03-02-2002, 12:57 PM

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