moejo Posted August 11, 2006 Share Posted August 11, 2006 What I have been trying to do is try to make a program where the gui will show the Mouse's position. This is kinda like what AutoIt Window info program does. Anyone knows the script in doing this? Thanks Link to comment Share on other sites More sharing options...
Helge Posted August 11, 2006 Share Posted August 11, 2006 (edited) 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 August 11, 2006 by Helge Link to comment Share on other sites More sharing options...
moejo Posted August 11, 2006 Author Share Posted August 11, 2006 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 More sharing options...
MHz Posted August 12, 2006 Share Posted August 12, 2006 Get rid of the 2nd comma and you maybe close. GuiCtrlSetData usually uses 2 parameters. Link to comment Share on other sites More sharing options...
moejo Posted August 12, 2006 Author Share Posted August 12, 2006 Get rid of the 2nd comma and you maybe close. GuiCtrlSetData usually uses 2 parameters. 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 More sharing options...
Moderators SmOke_N Posted August 12, 2006 Moderators Share Posted August 12, 2006 If IsArray($pos) Then Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Richard Robertson Posted August 12, 2006 Share Posted August 12, 2006 Try $pos[0] & ', ' & $pos[1]. That would be like '45, 300' or whatever values. Link to comment Share on other sites More sharing options...
Helge Posted August 12, 2006 Share Posted August 12, 2006 (edited) If IsArray($pos) ThenIf 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 Edited August 12, 2006 by Helge Link to comment Share on other sites More sharing options...
Paulie Posted August 12, 2006 Share Posted August 12, 2006 #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 More sharing options...
Tomahawk Posted August 13, 2006 Share Posted August 13, 2006 I had made a script to aid me in this and make it much easier to find your mouse position. You can get it here includes source code.http://24.7.205.17/~downloads/Mouse_Position.rar Link to comment Share on other sites More sharing options...
moejo Posted August 13, 2006 Author Share Posted August 13, 2006 Thanks for all your replys, i know have mouse position to work 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