Guest KageReza Posted January 23, 2005 Posted January 23, 2005 i am making a script to drag and drop items from a possition that I select on my desktop, and drag it to a spot that I select on my desktop. I neeed a command that will allow me to get those 2 possitions so that i can put them my script. So far i have used MouseGetPos, but i can only get one possition with that. Is there a way to get 2, by using it in the same script?
phillip123adams Posted January 23, 2005 Posted January 23, 2005 (edited) i am making a script to drag and drop items from a possition that I select on my desktop, and drag it to a spot that I select on my desktop. I neeed a command that will allow me to get those 2 possitions so that i can put them my script. So far i have used MouseGetPos, but i can only get one possition with that. Is there a way to get 2, by using it in the same script?<{POST_SNAPBACK}>Perhaps someone else has a better way, but here's what I just came up with. It uses the space bar as a hot key to tell the script when the mouse is in the desired position.HotKeySet("{SPACE}", "_PointPicked") $aPick1 = 0 $aPick2 = 0 SplashTextOn("1st Point", "Position Mouse at 1st point and press the SPACE bar", 450, 20) While $aPick1 = 0 sleep(10) Wend SplashTextOn("2nd Point", "Position Mouse at 2nd point and press the SPACE bar", 450, 20) While $aPick2 = 0 sleep(10) Wend SplashOff() MsgBox(4096, "Picked points", "The 2 picked points are:" & @lf & $aPick1[0] & "," & $aPick1[1] & @lf & $aPick2[0] & "," & $aPick2[1]) Exit Func _PointPicked() If $aPick1 = 0 Then $aPick1 = MouseGetPos() Else $aPick2 = MouseGetPos() HotKeySet("{SPACE}") EndIf EndFuncEDIT: Added 2 sleeps Edited January 23, 2005 by phillip123adams Phillip
charlestown4 Posted January 24, 2005 Posted January 24, 2005 Or you could use the included window info application to get co-ords, titles, window text, etc. *gasp*It really works!
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