Jump to content
Sign in to follow this  
JonnySpec

Can not get button to click

Recommended Posts

I am trying to automate a process. Below is the basic code for starting and clicking the first button" my issue is that the button does not click. I have looked at the manual (Standard RTFM first) but to no avail. any suggestions would be great . Thanks in advance.

And now the code:

run("C:\Program Files\Business Objects\BusinessObjects Enterprise 11.5\win32_x86\ImportWiz.exe")
$handle = WinGetHandle("[CLASS:#32770]")
WinActivate($handle)
$chandle = Controlgethandle($handle,"",12324)
WinActivate($handle)
ControlSend($handle,"",$chandle,"!n",0)
WinActivate($handle)

Share this post


Link to post
Share on other sites

Still a No-Go . Button is not clicking

Updated Code:

run("C:\Program Files\Business Objects\BusinessObjects Enterprise 11.5\win32_x86\ImportWiz.exe")
$handle = WinGetHandle("[CLASS:#32770]")
WinWait($handle)
WinActivate($handle)
$chandle = Controlgethandle($handle,"",12324)
ControlSend($handle,"",$chandle,"!n",0)
WinWait($handle)
WinActivate($handle)
Edited by JonnySpec

Share this post


Link to post
Share on other sites

You are still trying to get the handle, perhaps before it exists because you have WinGetHandle() BEFORE WinWait().

Also, class #32770 is a very common dialog class, and there are probably more than one open at any given time (some hidden). You need to be more specific, like:

WinWait("[CLASS:#32770; TITLE:Your Window Title Here]", "", 10) ; Wait max 10sec for window to appear
$hWin = WinGetHandle("[CLASS:#32770; TITLE:Your Window Title Here]", "")
If @error = 0 Then
     MsgBox(64, "Success", "Got window handle:  " & $hWin)
Else
     MsgBox(16, "Error", "Failed to get window handle!")
     Exit
EndIf

;)

Edited by PsaltyDS

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...