Jump to content
Sign in to follow this  

ControlSend, ControlClick, nothing works on this App

Recommended Posts

Hi all

i have this app that is used for updating our companies financial software and i'm trying to automate it.

My problem is that none of Send, ControlClick, ControlSend, ControlSendText are working on this app. There is one other app that is used for backup and i automated that with no problems.

The problematic app opens normally with ShellExecute and has a Start button to start update process that can be clicked or run using Alt+S. I've tried everything i can think of but just can't click that button.

Here is the code i've tried:

#include <Debug.au3>
#include <MsgBoxConstants.au3>

_DebugSetup("Debugw", True)
;_DebugSetup("Debugw", False, 4, "wFlash.txt", True)
WinMove("Debugw", "", 7, 6, 427, 319)

_DebugOut("Opening Fresh")
ShellExecute ("Fresh.exe","", "...")
If @error Then
    MsgBox($MB_SYSTEMMODAL, "Error", "Fresh error "& $iFlash)
$hWndFresh = WinWait("Fresh", "", 10)
If $hWndFresh == 0 Then
    MsgBox($MB_SYSTEMMODAL, "Error", "Fresh not started.")
    _DebugOut("Fresh not started")
_DebugOut("Fresh started")
$hCtrlStart = ControlGetHandle ($hWndFresh, "", 16408)
_DebugOut("Start handle: " & $hCtrlStart)
;$ctrlClc = ControlClick ($hWndFresh, "", 16408) ; no error but nothing happening
;$ctrlClc = ControlSend ($hWndFresh, "", 16408, "!{s}") ; no error but nothing happening
;$ctrlClc = ControlSetText ($hWndFresh, "", 16408, "!{s}") ; error - window/control is not found. !? not sure what's happening here
;$ctrlClc = ControlClick ($hWndFresh, "", $hCtrlStart) ; no error but nothing happening
$ctrlClc = ControlSend ($hWndFresh, "", $hCtrlStart, "!{s}") ; no error but nothing happening
If $ctrlClc == 0 Then
    MsgBox($MB_SYSTEMMODAL, "Error", $ctrlClc & " - window/control is not found.")
    _DebugOut("window/control is not found")

Here is some window info:

Title: Fresh V.14.10.07

Class: ClaWin0400000H_1

Some control info:

Class: ClaButton_0400000H

Instance: 1

ClassnemeNN: ClaButton_0400000H1


Advanced Mode: [CLASS:ClaButton_0400000H; INSTANCE:1]

ID: 16408

Text: &Start

AutoIt is version under Win 8.1

Any ideas?


Share this post

Link to post
Share on other sites

You have problem with the run button or with everything else?

I would try to use Run, with FileSelectFolder (if multipel ppl will use the program, they can select the folder where their copy of the program is, and the script starts to autorun it),

Also you can try to use AU3Recotrder to simply record yourself clicking the button (don't know why should it work while the others dont, but it could worth a try in my opinion)

Edited for AU3Recorder

Edited by SorryButImaNewbie

Share this post

Link to post
Share on other sites

Thx SorryButImaNewbie.

There are 4 buttons, Start, Settings, Help and Exit. None of which i am able to use.

Tried Run() but it does not run the app. That's why i'm using ShellExecute.

Share this post

Link to post
Share on other sites

If it fails, it might be that the controls are not standard, and fall outside the boundries of what AutoIt can manipulate natively.

If that is the case, your next port of call should be '?do=embed' frameborder='0' data-embedContent>>

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Share this post

Link to post
Share on other sites

My smili did not go through. :-(

As in most cases, app opens but click is still not working. I also tried to change focus with ControlFocus to a different button but dat also did not work.

Could it be some permission problem or the language the app was written in?

Share this post

Link to post
Share on other sites

If you are using WinActivate along with Send or the others, you should get a result.

I always play it safe, by also using WinActive, usually with a timeout etc.

Make sure brain is in gear before opening mouth!
Remember, what is not said, can be just as important as what is said.


What is the Secret Key? Life is like a Donut

If I put effort into communication, I expect you to read properly & fully, or just not comment.
Ignoring those who try to divert conversation with irrelevancies.
If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it.
I'm only big and bad, to those who have an over-active imagination.

I may have the Artistic Liesense ;) to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)


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