?
Solved

Loading a 256 colour cursor

Posted on 2002-05-20
4
Medium Priority
?
244 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
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.
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses

762 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