Jump to content

MouseGetPos()


moejo
 Share

Recommended Posts

Check out GUIGetCursorInfo in the helpfile.

Edit : Ooh. Did you mean that you want to show the numbers returned from

MouseGetPos in a GUI ? If so, just create a GUI, a label (or whatever) and put

the data there with GUICtrlSetData. Check out some GUI-examples if you're

new with GUIs.

Edited by Helge
Link to comment
Share on other sites

Edit : Ooh. Did you mean that you want to show the numbers returned from

MouseGetPos in a GUI ? If so, just create a GUI, a label (or whatever) and put

the data there with GUICtrlSetData. Check out some GUI-examples if you're

new with GUIs.

Yup, anyway, is it something like this?

$pos = MouseGetPos()

GUICtrlSetData ( -1, $pos[0],$pos[1] )

Link to comment
Share on other sites

Get rid of the 2nd comma and you maybe close. GuiCtrlSetData usually uses 2 parameters. :whistle:

Yargg! did that and an error showed up :S

GuiCtrlSetData (-1,$pos[0]$pos[1])

GuiCtrlSetData(-1,^Error

Error:Error in Expression

Link to comment
Share on other sites

If IsArray($pos) Then

If you read the error-message then you will see that that's not the problem in his case.

Not the use of the &'s.

GuiCtrlSetData (-1,$pos[0] & "x" & $pos[1])

Edit : Icekirby1 beat me to it. Multi-tasking isn't working very well for me :whistle:

Edited by Helge
Link to comment
Share on other sites

#include <GUIConstants.au3>

$Window = GUiCreate("Mouse Position", 300, 50)
$label1 = GUiCtrlCreateLabel("Current Mouse Position = ", 10, 10, 280, 30)
GUiSetState()

While 1
$pos = MouseGetPos()

GUiCtrlSetData($label1, ("Current Mouse Position = "& $pos[0] &", "&$pos[1]);Sorry if wrong syntax(In a hotel computer, Only one window allowed open at a time)
Wend

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...