
Now, the sizes of the bitmap tell you the nominal size of the mouse cursor, but that’s not the same as the apparent size. Interpreting these bitmaps is a bit tricky.įor color cursors, the hbmMask and hbmColor bitmaps are the same size, each of which is the size of the cursor.įor monochrome cursors, the hbmMask is twice the height of the cursor (with the AND mask on top and the XOR mask on the bottom), and there is no hbmColor. The bitmaps that are used to draw the cursor are available as the hbmMask and hbmCursor. Once you have your HCURSOR, you can call GetIconInfo² to obtain information about it. For example, if you are interested in the size of the arrow cursor, you can call LoadCursor(nullptr, IDC_ARROW).¹ In order to answer the question “What is the size of the mouse cursor?” you first have to specify which mouse cursor you are interested in, in the form of an HCURSOR. We learned last time that the SM_ CXCURSOR tells you the size the mouse cursor would have been in some hypothetical universe, which doesn’t really help you find out what the size of the cursor is in the current universe based in reality. This is, however, just a correlation there is no requirement that the two values be aligned with each other in any way. The SM_ CXICON system metric gives you the size of “standard” icons, which is loosely correlated with the size of the mouse cursor, in the sense that people who choose bigger icons tend also to choose bigger mouse cursors.

They called GetSystemMetrics( SM_CXICON), but the value that was returned didn’t seem to be right.

A customer wanted to know how to find out the size of the mouse cursor.
