[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

set cursor size to 64*64

Posted on 2002-05-30
6
Medium Priority
?
827 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 225 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
Independent Software Vendors: 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!

 
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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

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: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
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.
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

873 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