b3lorixx Posted March 4, 2011 Share Posted March 4, 2011 (edited) Im looking for a script that will wait for a mouse click then give the coords of the mouse click from within a Control so i can use Controlclick, ive tried _IfPressed and i have no luck. Edited March 4, 2011 by b3lorixx Link to comment Share on other sites More sharing options...
Kondro Posted March 5, 2011 Share Posted March 5, 2011 http://www.autoitscript.com/autoit3/docs/functions/MouseGetPos.htm Link to comment Share on other sites More sharing options...
Cake Posted March 5, 2011 Share Posted March 5, 2011 (edited) #include <Misc.au3> #Include <WinAPI.au3> HotKeySet("{esc}", "_exit") $_Title = "[CLASS:Notepad]" ; I've used the text field in notepad as an example. $_Text = "" $_ControlID = "[CLASS:Edit; INSTANCE:1]" $hWnd = ControlGetHandle($_Title, $_Text, $_ControlID) ; Get the handle of the control you want to check. While 1 If _IsPressed(0x01) Then ; Check if left mouse button is clicked. $tPoint = _WinAPI_GetMousePos() ; Get the position of the mouse. If _WinAPI_WindowFromPoint($tPoint) = $hWnd Then ; Retrieve the handle of the window that contains the specified point (mouse position) & MsgBox(0,"","The Cake Is Alive!") ; do stuff if the the handles are the same. EndIf EndIf WEnd Func _exit() Exit EndFunc Edit: Added some comments. Edited March 5, 2011 by Cake Link to comment Share on other sites More sharing options...
b3lorixx Posted March 6, 2011 Author Share Posted March 6, 2011 Yes, however im using an IE embed (which i should have specified) and that method is not working 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