Jump to content

Recommended Posts

Posted

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

Posted (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 by DarthCookieMonster
Posted

"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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...