NELyon Posted June 4, 2006 Share Posted June 4, 2006 I was wondering if someone could help me. I need just a simple window, nothing but text that tells me the mouses X*Y Coordinates(sp?). could anyone help me out? Link to comment Share on other sites More sharing options...
Nomad Posted June 4, 2006 Share Posted June 4, 2006 (edited) $xy = MouseGetPos() msgbox(0, "Mouse Coordinates", "X position = " & $xy[0] & @CRLF & "Y Position = " & $xy[1]) Nomad Edited June 4, 2006 by Nomad Link to comment Share on other sites More sharing options...
cppman Posted June 4, 2006 Share Posted June 4, 2006 #include <GUIConstants.au3> GUICreate("Mouse Coords", 200, 200) ;This Creates the GUI Window $xpos = GUICtrlCreateLabel("Ordinate X: ", 10, 10, 200) ;This creates a label. $ypos = GUICtrlCreateLabel("Ordinate Y: ", 10, 30, 200) ;This creates another label. GUISetState(@SW_SHOW) ;We need to do this, so the GUI will show up. While 1 ;While loop. $Mpos = MouseGetPos() ;We get the position of the mouse. GUICtrlSetData($xpos, "Ordinate X: " & $Mpos[0]) ;Changes the label to the current mouse position. GUICtrlSetData($ypos, "Ordinate Y: " & $Mpos[1]) ;Changes the label to the current mouse position. $msg = GUIGetMsg() ;Get whatever has been pressed. Select ;Begin Case Statement Case $msg = $GUI_EVENT_CLOSE ;If the exit button is pressed then Exit ;exit the program EndSelect ;end the case statement. WEnd ;continue the loop Miva OS Project Link to comment Share on other sites More sharing options...
herewasplato Posted June 4, 2006 Share Posted June 4, 2006 ...and yet another way to do that:AutoItSetOption("MouseCoordMode", 1) ;Use Mouse Coordinates relative to window (1-rel to desktop) While 1 $pos = MouseGetPos() ToolTip("Desktop X: " & $pos[0] & ", " & "Desktop Y: " & $pos[1]) Sleep(10) WEnd [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
NELyon Posted June 4, 2006 Author Share Posted June 4, 2006 CHRIS, yours is exactly what i need! thank you. Link to comment Share on other sites More sharing options...
cppman Posted June 4, 2006 Share Posted June 4, 2006 CHRIS, yours is exactly what i need! thank you.np. Miva OS Project Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now