Page 1 of 1

Cusor Change and mouse cords.?

Posted: Mon May 03, 2010 2:31 am
by Livengood
does anyone know how to get the mouse cordnates on the screen that is clicked anywhere and will recored it in a listbox?

also, how can you change the cursor of a webbrowser? cause i got it to change the cursor of the form, but it just goes back to the regular cursor after you hover over it

Re: Cusor Change and mouse cords.?

Posted: Mon May 03, 2010 2:12 pm
by mandai
You could use GetAsyncKeyState to do checks for the state of each mouse button, if you keep track of which buttons are down/up you can add click down/up events to your listbox (reading Cursor.Position.X and Cursor.Position.Y for coordinates).

As for the webbrowser control it doesen't support mouse events or cursor properties (probably because these would interfere with scripts on web pages). You could try adding in some javascript or css code to each page that links to your cursor file though.

Edit: using javascript to modify the css would probably look something like this:
Code: Select all
document.body.style.cursor = "url(http://linktocursorfile/something.cur), pointer";

Re: Cusor Change and mouse cords.?

Posted: Mon May 03, 2010 11:23 pm
by Livengood
Thanks :D