THIS ANSWER IS OUT OF DATE
See 23W's answer instead. That looks right to me.
Raymond Chen has a blog post that explains the SM_CXCURSOR
and SM_CYCURSOR
system metrics were the size of the hardware cursor implemented by the display adapter. Since cursors are no longer a feature of modern display hardware, these values are obsolete, but the OS still reports values for backward compatibility.
Thanks to @SO_fix_the_vote_sorting_bug's comment for bringing this to my attention.
ORIGINAL ANSWER FOR HISTORICAL CONTEXT
There is some overlap in the APIs between icons and cursors in Windows. You can call GetIconInfoEx
with an HCURSOR as well as with an HICON. The structure you get back will have information about the hotspot.
I don't see a way to get the actual size. Technically, all cursor icons are a fixed size that you can get by asking the system (with GetSystemMetrics
) for SM_CXCURSOR
and SM_CYCURSOR
. The ones that appear smaller are actually that size, they just have a lots of transparent pixels. If you must know the apparent size, you'll have to extract the mask and scan the bits to figure out the bounding rectangle.