Jump to content

Cannot interact with window/controls...


StMaSi
 Share

Recommended Posts

Win XP Pro SP 3

AutoIt V3

AU3Info

I have an EXE-based patch updater that spawns a GUI window/interface (attachment 1) with multiple buttons/controls/etc. I have not been able to target the window or any of the buttons/controls/etc. within. AU3Info shows me some information about it (attachments 2 - 4), but no matter what I target, nothing happens. Unfortunately, there are no command-line switches to pipe through to the installer, so I can't do anything from that point of view. Any advice/suggestions? Here's the summary information:

>>>> Window <<<<

Title: Upgrade

Class: ThunderRT6FormDC

Position: 259, 177

Size: 507, 385

Style: 0x16C80080

ExStyle: 0x00000101

Handle: 0x000E0248

>>>> Control <<<<

Class:

Instance:

ClassnameNN:

Name:

Advanced (Class):

ID:

Text:

Position:

Size:

ControlClick Coords:

Style:

ExStyle:

Handle:

>>>> Mouse <<<<

Position: 625, 194

Cursor ID: 0

Color: 0x7D9BE3

>>>> StatusBar <<<<

>>>> ToolsBar <<<<

>>>> Visible Text <<<<

Cancel

Upgrade

>>>> Hidden Text <<<<

post-74520-0-84106000-1351185370_thumb.j

post-74520-0-07353600-1351185879_thumb.j

post-74520-0-08280600-1351185893_thumb.j

post-74520-0-81957600-1351186326_thumb.j

Link to comment
Share on other sites

  • Moderators

Hi, StMaSi. Can you tell us the name of the application you're installing/upgrading? Otherwise we're just shooting in the dark :)

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

It's an patch installer for a custom pharmacy application, written for our pharmacy. The app is called ConfigurX. The patch installer is an EXE that applies an embedded .MSP file in order to update an already-installed MSI. Unfortunately, I can't manually apply the .MSP file (after extracting the .MSP file from the EXE file) as it always errors out. Also, the vendor is no help...they say I won't be able to manually apply the .MSP file and that I just need to run the EXE and everything will be taken care of. Well, I thought it would be easier to be able to use an automation tool like AutoIt to hand this out to all of our PCs, but I just can't seem to interact with the patch installer. Thanx.

Link to comment
Share on other sites

Send a screenshot of what is returned by this (applicaiton must already be running)

$hUpgradeWin = WinGetHandle ( "[CLASS:ThunderRT6FormDC; TITLE:Upgrade]" )
If IsHWnd ( $hUpgradeWin ) Then
 $aClasses = WinGetClassList ( $hUpgradeWin )
Else
 $aClasses = "unable to find window"
EndIf
MsgBox ( 1,1,$aClasses )
Edited 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

cool beans, so i'm guessing you were not using the autoit info tool properly...to get the control info, you need to move the tools crosshair over the control.

Go ahead and do that against the Update button, and return us the screen shot of that, then we can help you click it...or run this, and return the output:

#include <Array.au3>
$hUpgradeWin = WinGetHandle ( "[CLASS:ThunderRT6FormDC; TITLE:Upgrade]" )
Dim $aControls[1][4]
$iCounter = 1
If IsHWnd ( $hUpgradeWin ) Then
 While IsHWnd ( ControlGetHandle ( $hUpgradeWin, "","[REGEXPCLASS:.*Button; INSTANCE:" & $iCounter & "]") )
  $hButton = ControlGetHandle ( $hUpgradeWin, "","[REGEXPCLASS:.*Button; INSTANCE:" & $iCounter & "]")
  $aPos = ControlGetPos ( $hUpgradeWin, "", $hButton )
  $text = ControlGetText ( $hUpgradeWin, "", $hButton )
  ReDim $aControls[$iCounter][4]
  $aControls[$iCounter-1][0] = $hButton
  $aControls[$iCounter-1][1] = $text
  $aControls[$iCounter-1][2] = $iCounter
  If IsArray ( $aPos ) Then
   $aControls[$iCounter-1][3] = $aPos[0] & "," & $aPos[1] & "," & $aPos[2] & "," & $aPos[3]
  Else
   $aControls[$iCounter-1][3] = "Can't get position"
  EndIf
  $iCounter += 1
 WEnd
Else
 MsgBox ( 1,1,"Unable to find window")
EndIf

_ArrayDisplay ( $aControls )

edit: fixed some syntax issues

Edited 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

I tried running the posted A3 script, but nothing happened, so I reverted to using the AU3Info program again. Here's the summary info, when hovering over just the "Update" button...

>>>> Window <<<<

Title: Upgrade

Class: ThunderRT6FormDC

Position: 160, 109

Size: 507, 385

Style: 0x16C80080

ExStyle: 0x00000101

Handle: 0x0004021A

>>>> Control <<<<

Class: ThunderRT6CommandButton

Instance: 2

ClassnameNN: ThunderRT6CommandButton2

Name:

Advanced (Class): [CLASS:ThunderRT6CommandButton; INSTANCE:2]

ID: 2

Text: Upgrade

Position: 256, 322

Size: 167, 23

ControlClick Coords: 69, 14

Style: 0x54012001

ExStyle: 0x00000004

Handle: 0x0010024A

>>>> Mouse <<<<

Position: 488, 474

Cursor ID: 0

Color: 0xECE9D8

>>>> StatusBar <<<<

>>>> ToolsBar <<<<

>>>> Visible Text <<<<

Cancel

Upgrade

>>>> Hidden Text <<<<

post-74520-0-37859700-1351200409_thumb.j

post-74520-0-69746600-1351200426_thumb.j

Edited by StMaSi
Link to comment
Share on other sites

so, you would do something like this...

; Get window handle
$hUpgradeWin = WinGetHandle ( "[CLASS:ThunderRT6FormDC; TITLE:Upgrade]" )
If Not IsHWnd ( $hUpgradeWin ) Then
 $bContinue = False
 MsgBox ( 1,1,"Unable to get window Handle")
Else
 $bContinue = True
EndIf
; Activate window handle
If $bContinue Then
 If Not IsHWnd ( WinActivate ( $hUpgradeWin ) ) Then
  $bContinue = False
  MsgBox ( 1,1, "Unable to activate window")
 EndIf
EndIf
; Get control handle
If $bContinue Then
 $hUpdateBtn = ControlGetHandle ( $hUpgradeWin, "", "[CLASS:ThunderRT6CommandButton; TEXT:Upgrade]" )
 If Not IsHWnd ( $hUpdateBtn ) Then
  $bContinue = False
  MsgBox ( 1,1,"Unable to get button Handle")
 EndIf
EndIf
; Focus on button ( I notice sometimes the click fails when skipping this step )
If $bContinue Then
 If Not ControlFocus ( $hUpgradeWin, "", $hUpdateBtn ) Then
  $bContinue = False
  MsgBox ( 1,1,"Unable to focus on button")
 EndIf
EndIf
; click button
If $bContinue Then
 If Not ControlClick ( $hUpgradeWin, "", $hUpdateBtn ) Then
  $bContinue = False
  MsgBox ( 1,1,"Unable to click button")
 EndIf
EndIf

it's a failry good (my opinion) example to use for scripting, so you know the failure point

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

Okay, here's the results...

First, I execute the patch installer. Then, this latest AutoIt script. If the patch installer window has focus, I receive an "Unable to get button Handle" error window. If the patch installer window does not have focus, I receive an "Unable to get window Handle" error window. Any other suggestions? Thanx.

post-74520-0-35119500-1351299610_thumb.j

post-74520-0-50112000-1351299618_thumb.j

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