
The second way was found here: we can get cursor size multiplier form registry value CursorSize under HKEY_CURRENT_USER\Software\Microsoft\Accessibility and then calculate the cursor size yourself.The first way is mentioned before: we need to get value from registry value CursorBaseSize under HKEY_CURRENT_USER\Control Panel\Cursors.

You can get a real cursor size in two ways: Thanks Han - MSFT for giving the initial point to start searching.

I found some proves for this here, but I'm not sure. I think the main bottleneck is that GetSystemMetrics function returns default cursor size (32x32) and it doesn't change after the cursor's size changing. I used answers for this question, but solved only troubles with color. pink cursor then bigger than standard one:Īfter this situation, I decided to do the same sandbox application, but via C++ and WinAPI. But then I found that when the user changes the cursor's size or color( Windows 10 feature), the program extracts an invalid cursor image that matches the original cursor neither in color nor in size. In most cases, this code works correctly and suits my tasks. Shortly, it gets cursor image via JNA and WinAPI, then shows this image on JFrame and sets custom cursor for this frame. I need to extract the cursor image for using it in my swing application (Java).įirstly, I found similar question, modified code snippet from an answer, and got this sandbox application.
