Cursors and Java


Joined
Mar 4, 2018
Messages
4
Reaction score
0
I've been trying to work out the Windows Cursors. I've successfully matched the Registry values to the names given to the various cursor types in the Mouse Properties dialog (the one accessed via the Control Panel).

For example, what the Registry calls the 'AppStarting' cursor, the Mouse Properties dialog calls the 'Working In Background' cursor, and so on.

Where I'm having trouble is using Java to set those cursors, because for many of them there doesn't appear to be a constant. In Cursor.java the various cursors are defined:

public static final int DEFAULT_CURSOR = 0;
public static final int CROSSHAIR_CURSOR = 1;
public static final int TEXT_CURSOR = 2;
public static final int WAIT_CURSOR = 3;
public static final int SW_RESIZE_CURSOR = 4;
public static final int SE_RESIZE_CURSOR = 5;
public static final int NW_RESIZE_CURSOR = 6;
public static final int NE_RESIZE_CURSOR = 7;
public static final int N_RESIZE_CURSOR = 8;
public static final int S_RESIZE_CURSOR = 9;
public static final int W_RESIZE_CURSOR = 10;
public static final int E_RESIZE_CURSOR = 11;
public static final int HAND_CURSOR = 12;
public static final int MOVE_CURSOR = 13;

But, after some testing, there are several registry values to which none of them correspond. For example, the registry 'App Starting', 'Help', 'No', 'NWPen', 'Person', 'Pin' and 'UpArrow' entries have no corresponding definition (and they're not just the ints after 13; I got a violation when I used 14 as the value).

More surprisingly, the registry 'Hand' value doesn't actually correspond to the HAND_CURSOR value. Setting a new cursor for the HAND_CURSOR definition doesn't change the value stored in the registry for the 'Hand' key.

So how do I set, say, the AppStarting cursor value using Java?

Info: Windows 10 64-bit jdk1.8.0_151
 
Ad

Advertisements


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top