Jump to content

ControlClick Help


Ponto0n
 Share

Recommended Posts

Hi everyone. I'm new to AutoIt (and any scripting in general) and I've tried to find the answer in the forums but I can't seem to find anything that is helping me make this work. I've been able to script a couple of installs, but for this one the ID changes every time you run the install. I've attached a screen shot from the window info tool and my script itself. the initial screen has multiple install options (I need to run one and then another) and they are, from what I can gather, hyperlinks and not buttons. my first attempt I just used the normal controlclick("title", "text", "ID") format. once that didn't work (I realized the ID kept changing) I started trying other things that I found in random threads and ended up with what I have below (the other control clicks should be fine. its only the first page that they keep changing.  so I'm pretty much lost at this point and don't know the best way to get this to work. any help would be greatly appreciated! and sorry if my script formatting is terrible or not efficient. like I'm said, I really don't know what I'm doing and just going off of what I found online.

Capture.thumb.PNG.4f3744784b05cec71ecce4Capture2.thumb.PNG.c8ee40e5144efa7e5a8f8

Link to comment
Share on other sites

First use the tittle to get the handle then get the class using _WinAPI_GetClassName then get from .app and append to your controls.

Saludos

Link to comment
Share on other sites

First use the tittle to get the handle then get the class using _WinAPI_GetClassName then get from .app and append to your controls.

Saludos

thanks for the reply.

this may be a dumb question, but isn't that the same information I get from the window info tool?

Link to comment
Share on other sites

I mean something like this:

Run(Your app full path)
Local $hwindow = WinWait("[TITLE:ProSystem fx Engagement Installation]")
Local $sClassWindow=_WinAPI_GetClassName($hwindow)
$sClassWindow=StringMid($sClassWindow,StringInStr($sClassWindow,".app"))
ControlClick($hwindow, "", "WindowsForms10.window.8" & $sClassWindow & "3", "left",1,8,10)

Also you can use Advanced Window Descriptions using REGEXPCLASS. But simple/easy way is that I show avobe.

Saludos

Edited by Danyfirex
Link to comment
Share on other sites

I mean something like this:

Run(Your app full path)
Local $hwindow = WinWait("[TITLE:ProSystem fx Engagement Installation]")
Local $sClassWindow=_WinAPI_GetClassName($hwindow)
$sClassWindow=StringMid($sClassWindow,StringInStr($sClassWindow,".app"))
ControlClick($hwindow, "", "WindowsForms10.window.8" & $sClassWindow & "3", "left",1,8,10)

Also you can use Advanced Window Descriptions using REGEXPCLASS. But simple/easy way is that I show avobe.

Saludos

thanks again for your reply. I tried what you suggested and I get an error. one thing I noticed when I typed it out was that on line3 at the =_WinAPI part, my _ isn't red like yours. I'm guessing that's the problem?

 

 

Capture3.thumb.PNG.e864e3cf7a0aa9258e201

Link to comment
Share on other sites

look SciTE  Debug console. I think the problem is you need to add #include <WinAPI.au3>

 

Saludos

Link to comment
Share on other sites

look SciTE  Debug console. I think the problem is you need to add #include <WinAPI.au3>

 

Saludos

ok. I added the #include <WinAPI.au3> line and now it runs without an error. unfortunately it doesn't click anything. is it possible that AutoIt just can't work with the installer for this application?

 

thanks so much for your replies. I really appreciate it!

Link to comment
Share on other sites

my code was wrong. This should work.

#include <WinAPI.au3>
Run(Your app full path)
Local $hwindow = WinWait("[TITLE:ProSystem fx Engagement Installation]")
Local $sClassWindow=_WinAPI_GetClassName($hwindow)
$sClassWindow=StringMid($sClassWindow,StringInStr($sClassWindow,".app"))
ControlClick($hwindow, "", "WindowsForms10.STATIC" & $sClassWindow & "3", "left",1,8,10) ;maybe no need to put x and y

Saludos

Link to comment
Share on other sites

my code was wrong. This should work.

#include <WinAPI.au3>
Run(Your app full path)
Local $hwindow = WinWait("[TITLE:ProSystem fx Engagement Installation]")
Local $sClassWindow=_WinAPI_GetClassName($hwindow)
$sClassWindow=StringMid($sClassWindow,StringInStr($sClassWindow,".app"))
ControlClick($hwindow, "", "WindowsForms10.STATIC" & $sClassWindow & "3", "left",1,8,10) ;maybe no need to put x and y

Saludos

Good morning. thanks again for the reply. I made the change, but still no luck. here's a picture of the installer screen. does it matter that's its not a standard button (I think)? I'm trying to get it to click on the SQL Express 2014 SP1 link. should it work the same for a normal looking button vs a link?

Link to comment
Share on other sites

Debug the code maybe with some little changes it will work. it's hard for me to help you because I have not access to the installer (and it's so big for downloading with my internet conection).

Saludos

Link to comment
Share on other sites

I think you're not playing with the code I put before. I had used it before successfully.

Saludos

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...