Solved

set cursor size to 64*64

Posted on 2002-05-30
6
750 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
[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
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
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!

 
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

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

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: 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…
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.
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

707 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