Solved

set cursor size to 64*64

Posted on 2002-05-30
6
703 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Perl Awk Need Help 3 109
Thin secure Windows 10 5 75
JQuery serialize and unserialize 8 51
how to use laptop or pad camera in vb.net windows application 2 54
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
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.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

895 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

17 Experts available now in Live!

Get 1:1 Help Now