Solved

set cursor size to 64*64

Posted on 2002-05-30
6
682 Views
Last Modified: 2013-11-20
mouse cursor is of size of 32*32,can i change it to 64*64?
how to do ?
waiting
thanks
0
Comment
Question by:kickdog
6 Comments
 
LVL 8

Accepted Solution

by:
fl0yd earned 75 total points
ID: 7046787
The problem here is that your actual display hardware is responsible for drawing the cursor, thus the hardware must support the appropriate size. Use GetSystemMetrics with SM_CXCURSOR and SM_CYCURSOR to retrieve the size supported by the hardware. The MSDN about GetSystemMetrics:
"Width and height, in pixels, of a cursor. The system cannot create cursors of other sizes."
However, the MSDN says about SetCursor:
"Windows 95: The width and height of the cursor must be the values returned by the GetSystemMetrics function for SM_CXCURSOR and SM_CYCURSOR. In addition, either the cursor bit depth must match the bit depth of the display or the cursor must be monochrome."
So this sounds a lot like you could create a cursor of other dimensions on system other than win95 -- on the other hand on CreateCursor which does take nWidth and nHeight parameters it is stated again, that the system can only create cursors of size SM_CXCURSOR x SM_CYCURSOR. You will have to try it yourself...
0
 

Author Comment

by:kickdog
ID: 7048499
but i can change standard cursor to larger cursor using
windows tool,how does it do?
0
 

Author Comment

by:kickdog
ID: 7048501
why can it work?
please tell me its principle.
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 2

Expert Comment

by:vbk_bgm
ID: 7048576
Perhaps you can try this
Go to the resource editor, Insert New Cursor
Click on New Cursor Image (this is next to combobox)
Choose Custom (specify 64x64, 16 colors). Then draw your cursor
In your app, put this code
HCURSOR hCursor = LoadCursor(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDC_CURSOR1));
SetCursor(hCursor);
where IDC_CURSOR1 is the cursor in the resource editor
0
 
LVL 8

Expert Comment

by:fl0yd
ID: 7048636
Creating a cursor in the resource editor and loading with LoadCursor( ... ) is the same as creating a cursor using CreateCursor( ... ). With CreateCursor you can also specify nWidth and nHeight -- but like I stated above, the MSDN states that only cursors of size SM_CXCURSOR x SM_CYCURSOR can be created.
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7049251
I think you will need to use the LoadImage API in order to get an HCURSOR for an unusually-sized cursor.  The LoadCursor API is going to grab the 32x32 cursor from the resource file.

-- Dan
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

759 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now