We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you a podcast all about Citrix Workspace, moving to the cloud, and analytics & intelligence. Episode 2 coming soon!Listen Now


color mouse cursor

minnirok asked
Medium Priority
Last Modified: 2013-11-20

Can someone explain how to set the mouse cursor from a color bitmap or ico file? I have the following so far:

BOOL CMyApp::OnInit()
    m_MyCursor = LoadCursor(IDC_MY_ICON_RES_ID);

BOOL CMyView::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message)
    return TRUE;

I'm not sure if loading from a 32x32 .ico file is appropriate. The above works with a .cur file. So how can I modify this to get some color in the cursor?

Watch Question

In Visual C++ .Net 2003:

- Open up the cursor resource in the resource editor
- Right-mouse in the editor window to bring up a large menu
- Near the bottom of the menu select "New Image Type", pick something that is not monochrome, such as 32x32, 16 colors
- Edit your cursor with fancy colors
- Right-mouse, select Current Cursor Image Types, drag across, select the monochrome bitmap. You should see your boring monochrome cursor again.
- Right-mouse, select "Delete Image Type", this deletes the monochrome bitmap
- When you save, your cursor will now contain only a color bitmap

Just rebuild and you will have it.

You can also import a cursor file with a color bitmap, that will work too.

The idea is similar in Visual C++ 6.0, although the resource editor is quite a bit different.

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
mahesh1402IT Professional
Top Expert 2005

You may also try LoadImage instead of LoadCursor.

However you need to delete the default monochrome device image like follows:

Open the cursor image, select monochrome device, click Image -> Delete Device Image.

Then you can add the WM_SETCURSOR handle, and modify the function as:

BOOL CMyView::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message)
              return TRUE;      

Then you can use your colored cursor

More Information Refer : Q135047 HOWTO: Use Resource Editor for 16-Color 32x32 Mouse Pointers

http://support.microsoft.com/support/kb/articles/q135/0/47.asp <==



Works perfectly, thanks.
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.