1
I made a program to identify if the mouse cursor is Hand
or not. I’m using an event that identifies the global cursor, so even outside the Form
he is able to identify. The problem is that in the function:
private static bool Cursor()
{
var h = Cursors.Hand.Handle;
CURSORINFO pci;
pci.cbSize = Marshal.SizeOf(typeof(CURSORINFO));
GetCursorInfo(out pci);
return pci.hCursor == h;
}
When I test it on a button by placing the mouse on top of some Link or other thing that makes the cursor Hand
, it does not identify! But if I change and put Cursors.Default.Handle
it always identifies whether the cursor is Default or not.
What am I doing wrong ? How to identify if the cursor is Hand
or not ?
To catch the current cursor is not Cursor.Current ?
– PauloHDSousa