Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Loading a 256 colour cursor

Posted on 2002-05-20
4
Medium Priority
?
249 Views
Last Modified: 2013-11-20
How do I programmatically load and display a custom 256 colour cursor into a view. MFC only seems to display monochrome cursors.
0
Comment
Question by:WarrenW
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 49

Accepted Solution

by:
DanRollins earned 200 total points
ID: 7023124
You need to provide a handler for WM_SETCURSOR.  

Early in the program, load the cursor and save its handle.  E.g.,
    m_hcurView= AfxGetApp()->LoadCursor( IDC_MY256COLORCURSOR );

In your OnSetCursor fn, use

  ::SetCursor( m_hcurView );
  return( TRUE );

Another tip:  In order to create a 256-color-cursor resource, you need to create a new cursor, then use menu commands:

1) Image>New Device Image
2) [Custom]
3) Set size and color depth
4) Paste the 356-color image into the pcicture

5) select the orginal 32x32 mono from the Cursor-editor "Device:" drop-down box

6) Image > Delete Device Image

that way there is only one image (the 256-color one) in the cursor resource.

Finally, the pallet is limited.  Lots of pictures that look great in 24-bit color look crappy when translated into the standard 256-color palette.

-- Dan
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
Ready to get certified? Check out some courses that help you prepare for third-party exams.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Suggested Courses

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question