Get mouse cursor image position

I get mouse position and mouse image (icon). but I need one more thing that I cannot find anywhere: How can I find the cursor location in an icon representing the position of the mouse means: each icon of the mouse cursor has a diff location, for example, the default mouse cursor will be at the value of 0.0 icon , but in the move icon the cursor will be in the center of the image (icon).

+4
source share
1 answer

You can use the GetIconInfo() function of the Win32 ( via pinvoke ) - this populates the ICONINFO structure, which has fields that provide the x and y access point for the cursor.

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

+5
source

Source: https://habr.com/ru/post/1501009/


All Articles