Jump to content

Restore window


Recommended Posts

I am putting together a script that will run and complete all the fields for an installer - LogmeIn.

The issue that I have is that, if the user clicks outside the main install window or another program takes focus, the script will fail because it will not send the commands properly.

This is what I use to check and restore the window before I move on:

If WinExists("LogMeIn", "Power Management") = 1 Then
        WinWait("LogMeIn", "Power Management")
        WinActivate("LogMeIn", "Power Management")
        WinWaitActive("LogMeIn", "Power Management")
        ControlClick("LogMeIn", "",954) ; unselect AC option
        ControlClick("LogMeIn", "",623) ; if window is availalbe click to unselect the option
        ; and then click Next

    EndIf

That did not restore the focus.

I also tried the code below but it only worked with the first dialog screen - I need this to be applied to all screens:

$handle2=WinGetHandle("LogMeIn License Agreement","")
if @error then
    MsgBox(0,"","There was an error installing. Please restart the installation!")
    exit 3
else
    WinSetState ( "LogMeIn License Agreement", "", @SW_SHOW )
    WinWait("LogMeIn License Agreement","")
    WinActivate("LogMeIn Licesnse Agreement","")
    WinWaitActive("LogMeIn License Agreement","")
    ControlClick("LogMeIn", "",623);Button ID for NEXT / AGREE
Endif

Any help will be appreciated.

Thank you

Link to comment
Share on other sites

Which LogMeIn Product do you use?

Edit:

$handle2=WinGetHandle(" LogMeIn License Agreement","")
if @error then
    MsgBox(0,"","There was an error installing. Please restart the installation!")
    exit 3
else
    WinActivate($handle2,"")
    WinWaitActive($handle2,"")
    ControlClick($handle2, "", "[TEXT:I Agree]");Button ID for NEXT / AGREE
Endif

Note that name of the main win have starting space

Edit2:

Im 99% shure that LogMeIn.msi support silent instalation (hit search button on forum or hit google)

And that crontolclick is working with no focus on that win

Edited by bogQ

TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)



460px-Thief-4-temp-banner.jpg
There are those that believe that the perfect heist lies in the preparation.
Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost.

 
Link to comment
Share on other sites

Which LogMeIn Product do you use?

Edit:

$handle2=WinGetHandle(" LogMeIn License Agreement","")
if @error then
    MsgBox(0,"","There was an error installing. Please restart the installation!")
    exit 3
else
    WinActivate($handle2,"")
    WinWaitActive($handle2,"")
    ControlClick($handle2, "", "[TEXT:I Agree]");Button ID for NEXT / AGREE
Endif

Note that name of the main win have starting space

Edit2:

Im 99% shure that LogMeIn.msi support silent instalation (hit search button on forum or hit google)

And that crontolclick is working with no focus on that win

I use the free version and that is why I cannot have a silent installer.

ControlClick($handle2, "", "[TEXT:I Agree]");Button ID for NEXT / AGREE

Will this send the click to the button or to the W
Link to comment
Share on other sites

It shud send click to button, my version dont have 623 ID on that button, and with text if im not wrong it shud work on diffrent versions.

Once again so that you dont miss it, its " LogMeIn License Agreement" not "LogMeIn License Agreement" ;)

Did you test to see if my code is working on your version of logmein?

Edited by bogQ

TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)



460px-Thief-4-temp-banner.jpg
There are those that believe that the perfect heist lies in the preparation.
Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost.

 
Link to comment
Share on other sites

It shud send click to button, my version dont have 623 ID on that button, and with text if im not wrong it shud work on diffrent versions.

Once again so that you dont miss it, its " LogMeIn License Agreement" not "LogMeIn License Agreement" ;)

Did you test to see if my code is working on your version of logmein?

I am testing it right now - give me few seconds
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...