Sign in to follow this  
Followers 0
BroadcastTech

Toolbar Button Support

10 posts in this topic

I have a MS Java app that has a Toolbar with three buttons.

The Window Spy shows it as "WFC.Toolbarwindow321"

How do I address any of the three buttons using AutoIt?

Using Visual Test I have been able to address the Buttons as:

WToolbarButtonClk("@1", "Button1")

WToolbarButtonClk("@1", "Button2")

WToolbarButtonClk("@1", "Button3")

Where Buttonx = the Text associated with each button.

So far I have been unable to make this work with AutoIt.

Share this post


Link to post
Share on other sites



It depends what you mean by "address", and what you mean by "unable to make it work".

Do you mean you cant figure out what the controls are called? Or the functions to make use of the control names?


Sitting comfortably behind the code.

Share this post


Link to post
Share on other sites

I can find the control fine. I can determine is position, but I can not figure out how to:

a. Determine the state of the three buttons

b. Push any of the three buttons.

The only way I have found kind of make it works is to use

ControlGetPos ("Instant", "", "WFC.ToolbarWindow321")

to determine the controls position. I can then use MouseClick to push any of the three buttons, but I have to go on faith that the buttons are enabled.

Not an ideal solution.

Share this post


Link to post
Share on other sites

hmmm... do CommandEnable() anyway, regardless of state, then you know they will be enabled when it comes to clicking them.


Sitting comfortably behind the code.

Share this post


Link to post
Share on other sites

If you want to click a button use the ControlClick function. Or look at the other Control* functions in the helpfile.


[font="Optima"]"Standing in the rain, twisted and insane, we are holding onto nothing.Feeling every breath, holding no regrets, we're still looking out for something."[/font]Note: my projects are off-line until I can spend more time to make them compatable with syntax changes.

Share this post


Link to post
Share on other sites

An example of what I am trying to do might be to click on one of the Links Buttons on the Link Toolbar in Internet Explorer.

AutoSpy correctly identifies the Toolbar as "Toolbar321", but what is the syntax to Press the Button Marked "Google", or "HiddenSoft" on said toolbar?

Share this post


Link to post
Share on other sites

AutoSpy correctly identifies the Toolbar as "Toolbar321", but what is the syntax to Press the Button Marked "Google", or "HiddenSoft" on said toolbar?

ControlClick it, and then ControlSend either the name of the item you wish to click (it will select the closest match until it either has a complete match, or your press enter.) You could also send the down keystroke until you reached the item you wanted.

If you want to open one of those links, wouldn't it be a lot eaisier to open exploer with that link to start with from AutoIt? There's no point in using the links toolbar when you could just call Run('explorer.exe "http://www.my_url_goes_here.com"') instead. It looks a lot simplier to me.


[font="Optima"]"Standing in the rain, twisted and insane, we are holding onto nothing.Feeling every breath, holding no regrets, we're still looking out for something."[/font]Note: my projects are off-line until I can spend more time to make them compatable with syntax changes.

Share this post


Link to post
Share on other sites

If you want to open one of those links, wouldn't it be a lot eaisier to open exploer with that link to start with from AutoIt? There's no point in using the links toolbar when you could just call Run('explorer.exe "http://www.my_url_goes_here.com"') instead. It looks a lot simplier to me.

I was giving you an example of what I am trying to do that is simular to my application as far as clicking a toolbar button by name.

My application has three buttons in a Toolbar Control.

From launch Button 1 shold be enabled, and BUtton 2 and three should be disabled.

If you click the first, it should grey out and enable the second and third.

If you then click on the Second the first and second should be grey, and trhe third enabled.

If you then click on the third, you should return to the initial state.

I will play with the "ControlClick it, and then ControlSend " to see if that works for me.

Share this post


Link to post
Share on other sites

ControlSend Does not appear to work with toolbar buttons.

Buttons work fine, but I can not make toolbar buttons work.

Share this post


Link to post
Share on other sites

ControlSend Does not appear to work with toolbar buttons.

Buttons work fine, but I can not make toolbar buttons work.

I believe that you've just made a true statement.

"I'm not even supposed to be here today!" -Dante (Hicks)

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