es1984 Posted October 2, 2014 Share Posted October 2, 2014 MouseClick() is not working following the use of WinActivate(), whilst the mouse moves to the correct location the click action does not appear to action. Code as follows: #RequireAdmin Opt("MouseCoordMode",0) WinActivate("wePresent WiPG-1000" , "") MouseClick("left",267,11,2,1) If i remove the WinActivate() command and switch to absolute coords as follows, it works. #RequireAdmin Opt("MouseCoordMode",1) MouseClick("left",400,400,2,1) Why is use of WinActivate() resulting in this issue? How do I overcome. Thanks Link to comment Share on other sites More sharing options...
Bert Posted October 2, 2014 Share Posted October 2, 2014 (edited) The title your using is wrong thus it can't find the window. Try this: #RequireAdmin #include <MsgBoxConstants.au3> Opt("WinTitleMatchMode", 2) Opt("MouseCoordMode",0) WinActivate("wePresent" , "") If WinActive("wePresent") Then ; Check if wePresent is currently active. MsgBox($MB_SYSTEMMODAL, "", "WinActive" & @CRLF & "wePresent is active.") Else MsgBox($MB_SYSTEMMODAL, "", "WinActive" & @CRLF & "wePresent is not active. Look in the help file for 'Window Titles and Text (Advanced'") EndIf ;MouseClick("left",267,11,2,1) ;commented out for now to verify if you can activate the window or not. ;once you can activate the window comment out the If statement above and remove the comment for the mouseclick. I added Opt("WinTitleMatchMode", 2) to look for a substring of the window. Edited October 2, 2014 by DarthCookieMonster The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
es1984 Posted October 2, 2014 Author Share Posted October 2, 2014 "We present is active" displayed successfully, however same effect when if statement is commented and the mouseclick() uncommented; mouse moves but does not appear to click. I copied the full title from 'Window Info'. Why do you suspect it is incorrect? Thanks Link to comment Share on other sites More sharing options...
jdelaney Posted October 2, 2014 Share Posted October 2, 2014 (edited) Use controlclick...skip the inaccuracy of attempting to click coords...only game automation needs click coords (99% of the time, at least). Edited October 2, 2014 by jdelaney IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window. Link to comment Share on other sites More sharing options...
Bert Posted October 2, 2014 Share Posted October 2, 2014 oh, ok...try using mouse move using the mouse coords you have for mouse click and see if the mouse goes to the correct place. It may be moving to the wrong position. The Vollatran project My blog: http://www.vollysinterestingshit.com/ 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