• 13
• 18
• 19
• 27
• 10

# Custom cursors stuck at 32x32

This topic is 3890 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hi I'm trying to change my cursor to a custom one whenever a certain button on a toolbar is clicked. I'm using plain old WinAPI. This is my process. CurTest.rc
MYCUR CURSOR "../Images/MyCur.cur"


CurTest.cpp
#define MYCUR 100

// .. rest of program

/* In the WndProc */
switch(msg){
case WM_SETCURSOR:
SetCursor(hMyCur);
return 0;
}


No matter what size I actually make the cursor when I design it, it always comes out as a 32x32 image in my program and it looks really bad. I haven't really used cursors before, so I'm kind of new at this. Anyone have an idea on how to fix this?

##### Share on other sites
From MSDN on the subject (from the CreateCursor() reference):

Quote:
 The nWidth and nHeight parameters must specify a width and height that are supported by the current display driver, because the system cannot create cursors of other sizes. To determine the width and height supported by the display driver, use the GetSystemMetrics function, specifying the SM_CXCURSOR or SM_CYCURSOR value.

So you can probably only have 32x32 cursors. Bigger is not possible, smaller by having a 32x32 image but the unused areas filled with transparency.

HTH