Sign in to follow this  
Followers 0
nxs

Au3Info doesn't see button

13 posts in this topic

The company I work for uses a licensed bespoke exe that is no longer supported by the supplier.

It is a windows GUI that reads files that appear in its input directory, and writes responses to it's output directory.

It runs on Windows 2003 Server in the computer room.

The problem is, that it occasionally fails to respond, and needs to be restarted manually by the operators.

I thought, I would use a bit of initiative, and automate the restart when necessary using autoit.

I got it working quickly, and was very impressed with this tool!

I told everyone at work how good it was, and how the ops guys wouldn't need to be called out at night etc.

I set it up restarting on the test box every 30 seconds and sat back to watch it with a contented smile on my face.

Then the screen saver lock cut in, I typed the password and aargh, it had failed on a mouse click!

I have read various threads pointing out that this is not a bug, and i understand.

The answer is to use Control Click.

The trouble is that Au3Info doesn't see one particular group of buttons, so I clicked them by coordinate.

When you use the GUI manually, you can't tab to these buttons, or use Alt <whatever> either.

The buttons appear to be images with a bevel around them and they repond to a mouse click using any mouse button, and appear to 'go in'.

I guess that they may be 'Custom Controls' ?

I down loaded the vb decompiler lite, and tried it on the exe - bingo, it is vb!

I say bingo, but I am not a windows or vb programmer, and the lite decompiler doesn't do everything.

There are some procedures that look relevent, but I don't know if thay are accessible by autoit?

So, I seem to be at a dead end.

It is mandatory to have timed locking screensavers on all windows servers in the company.

I am on the point of giving up - no one asked me to do it in the first place!

Is there anyone out there who could nudge me in the right direction?

Share this post


Link to post
Share on other sites



Welcome to the forum.

I could not tell for sure from your post if you tried:

ControlClick("title", "text", "", "left", 1, x, y)

Leave the control info as "".


[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites

Thanks!

Just tried it - nothing happens.

A play with the coordinates shows that it is clicking the bottom left Normal Button

provided x,y are less than its width/height.

That is the button with the first tab order.

Here is a bit of ascii art

____________________________

| . . . Window Title . . . |

|__________________________|

|____________ ____________ |

|| Image . .| | Image . .| |

|| button 1 | | Button 2 | |

||__________| |__________| |

|____________ ___________ |

|| Image . .| | Image . .| |

|| button 3 | | Button 4 | |

||__________| |__________| |

| ___________ ___________ |

|| Normal . | | Normal . | |

|| Button . | | Button . | |

|| Exit . . | | Admin . .| |

||__________| |__________| |

|__________________________|

Share this post


Link to post
Share on other sites

I'm sure that you don't want to click it by coordinates, but setting coordinates relative to the 'Window Title' window can make it work better.

Opt("MouseCoordMode",2)

Or maybe clicking by pixel color?

Interesting problem you have, hehe.

Share this post


Link to post
Share on other sites

...A play with the coordinates shows that it is clicking the bottom left Normal Button

provided x,y are less than its width/height...

I've not used the x,y parm for ControlClick, but maybe you can use real control info from one of your "real" control/buttons and play with the x,y parm to see if you can make it click outside of the "real" button/control.... even though this would be against what the help file states under ControlClick:

The x position to click within the control

The y position to click within the control

Also, be sure and get your x,y values from this part of the Au3Info tool to start with: ControlClick Coords: 665, 107


[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites

I've not used the x,y parm for ControlClick, but maybe you can use real control info from one of your "real" control/buttons and play with the x,y parm to see if you can make it click outside of the "real" button/control.... even though this would be against what the help file states under ControlClick:

The x position to click within the control

The y position to click within the control

Yes, that was the first thing I tried! It won't click another control whatever the coordinates :):-(

Share this post


Link to post
Share on other sites

You can try the User Defined Function in this old post:

http://www.autoitscript.com/forum/index.ph...;showtopic=7112

Now this is the sort of thing I was hoping for!

It doesn't do anything for me though :)

I Just pasted the code into a file and added :-

Opt("MouseCoordMode", 0)

_MouseClickPlus("Document1", "left", 44, 11, 1)

I hoped this would click the open file dialog in a new Microsoft Word instance that I had open.

Ok maybe Word dosen't like it, maybe...

_MouseClickPlus("untitled", "left", 20, 60, 1)

click the Free form Select button in Paint

nope!

It doesn't press the buttons in my problem app either.

Am I just unlucky with my tests, or am I missing something do you think?

Thanks again tho'

Share this post


Link to post
Share on other sites

...Am I just unlucky with my tests, or am I missing something do you think?...

It did not work for me either.

I could not test last night.

Sorry for the bum steer.

...fresh out of ideas...


[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites

If you are trying to interact with the controls without using MouseClick (or moving the mouse) you could try getting the information with this:

http://www.autoitscript.com/forum/index.ph...c=30717&hl=

If that doesn't work, you could try the below:

http://www.autoitscript.com/forum/index.ph...c=32781&hl=

After you see all the control information, just wade yourself through each one seeing if you can find the right button.

If that doesn't work, it's slim to none that you'll be able to do it without moving the mouse and using regular mouse click.


Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites

If that doesn't work, you could try the below:

http://www.autoitscript.com/forum/index.ph...c=32781&hl=

After you see all the control information, just wade yourself through each one seeing if you can find the right button.

I used the corrected version from later in the post.

I didn't understand your example usage, so I hacked it slightly to this :-

Global $Array = _WinGetCtrlInfo(WinGetTitle('xxxxxx'))

Global $sOne = ''

Global $sTwo = ''

For $iCC = 0 To $Array[0][0]

$sOne &= '[' & $iCC & '][0] = ' & $Array[$iCC][0] & @CR

$sTwo &= '[' & $iCC & '][1] = ' & $Array[$iCC][1] & @CR

Next

MsgBox(64, 'WinInfo', StringTrimRight($sOne, 1) & @CR & StringTrimRight($sTwo, 1))

This reported :-

[0][0]=5

[1][0]=ThunderRT6CommandButton1

[2][0]=ThunderRT6CommandButton2

[3][0]=ThunderRT6CommandButton3

[4][0]=ThunderRT6CommandButton4

[5][0]=ThunderRT6Data1

[0][1]=

[1][1]=2

[2][1]=3

[3][1]=4

[4][1]=5

[5][1]=1

( must confess that my ascii art from a previous post was simplified - I really have four 'Normal' buttons that Au3Info can see

and four image buttons (two disabled) that Au3Info can't see)

The ThunderRT6Data is new to me

I also tried the Grabber from Ivan, this yielded :-

----------------------------------------------

Window Name:PRÆMIUM

++++++++++++++++++++++++++++++++++++++++++++++

CtrlId: ThunderRT6CommandButton2

Text: Change &Password

CtrlHndl: 0x0118039E

CtrlId: ThunderRT6CommandButton3

Text: &Hide

CtrlHndl: 0x014D03A6

CtrlId: ThunderRT6CommandButton4

Text: E&xit

CtrlHndl: 0x022A02DC

CtrlId: ThunderRT6CommandButton1

Text: &Administration

CtrlHndl: 0x0145035E

----------------------------------------------

Mmmm, it all seems a bit hopeless at the moment, but it's like an itch that I can't stop scratching :)

Nobody has picked up on the decompiler mention at all ....

Share this post


Link to post
Share on other sites

Nobody has picked up on the decompiler mention at all ....

I don't think it's a matter of us "picking" up on it, I know I did. But what you have provided ASCII art or not, simply is not enough.

If you want real help, by those that know what they are doing, most won't lift a finger unless they "A" have your script to work and debug on, "B" have the application to work and debug themselves, or in this case "A" and "B" (for me at least).

Other than that, we are doing nothing but waisting space with hypothetical guessing.


Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

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  
Followers 0