Jump to content

ControlClick issue after unlocking application


Go to solution Solved by blehbloo,

Recommended Posts

I have an application where I'm successfully able to ControlClick on a button.  This is assuming that I'm logged in to the application and am working.  This is the code

Local $hWnd = WinWait("[CLASS:WindowsForms10.Window.8.app.0.e4c6c4]", "", 10)
Sleep(2000)
ControlClick($hWnd, "", "Internet Explorer_Server1", "left", 1, 716, 94) ;this successfully clicks the button I need



I run into the issue when the Application is locked and I want my script to unlock the application and click a button.  My script enters the password and unlocks the application but the ControlClick no longer registers on the button.  This is the code:

Local $hWnd = WinWait("[CLASS:WindowsForms10.Window.8.app.0.e4c6c4]", "", 10)

Sleep(2000)

ControlClick($hWnd, "", "WindowsForms10.EDIT.app.0.e4c6c42", "left", 1, 53, 10) ;this clicks on the password field

Sleep(1200)

ControlSend($hWnd, "", "WindowsForms10.EDIT.app.0.e4c6c42", "password") ;this successfully sends the password text

Sleep(3000)

ControlClick($hWnd, "", "Internet Explorer_Server1", "left", 1, 716, 94) ;this fails to click the button I need

I've beat my head against the wall all day trying to figure this out but I'm not having any luck.

Any ideas?

Edited by blehbloo
Link to comment
Share on other sites

  • Solution

So this app (name?) is using an embedded IE control? Have you looked at using the _IE functions instead of ControlClick?

 

I'm not sure of the difference, to be honest.  However, I did just solve it.

For some reason, the first ControlClick just wasn't registering.  What I did was send two ControlClicks, seperated by about 3 seconds, and it works.  Not sure the exact reason behind that.

Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

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