Solved

Loading a 256 colour cursor

Posted on 2002-05-20
4
233 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
4 Comments
 
LVL 49

Accepted Solution

by:
DanRollins earned 50 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Installing Microsoft R server on REDHAT or SUSE Linux 4 147
Process filename extension 3 196
sum67 challenge 35 110
How do I get Window Title of all opened process? 4 14
In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
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 …
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.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

830 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