4

I get the mouse position, and the mouse image (icon). but i need one more thing that I can't find anywhere: How Can I get the location of the cursor in the icon that represent the mouse position, mean: every icon of the mouse cursor have diff location, for example the default mouse cursor would be in the 0,0 of the icon, but in the move icon, the cursor would be in the center of the image (icon).

1 Answer 1

5

You can use the GetIconInfo() Win32 function (via pinvoke) - this fills out an ICONINFO structure that has fields which provide the x and y hotspot for the cursor.

Note that when this function returns successfully it has also created two GDI bitmap objects, which you are responsible for freeing via DeleteObject().

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.