2
votes

it is possible to change global mouse cursor from c#? the thing is i use a global hook shortcut key to capture a window like spywindow and i want to change mouse cursor globally when i select my handle and restore it when i click left mouse. Another question is about the click itself. When I'm in capture mode can i take click just for my purpose?it will be nice if i didn't press stuff on screen when i select my window!. Thanks!

2

2 Answers

0
votes

Use

this.Cursor = Cursors.Cross; //to change the cursor to a cross, see Cursors for more options

when you select your handle, and when the left button is clicked use,

this.Cursor = Cursors.Default;

this should just be the relevant form/object that you want to change the cursor for.

-1
votes

For the cursor position, if you're using windows forms, just use System.Windows.Forms.Cursor.Position, as it is settable. The cursor class, not the cursor property of your form. To get global (screen) coords just use Form.PointToScreen(Point p). There's also PointToClient for the reverse.