Jump to content
Sign in to follow this  

Can't access to toolbar buttons inside app

Recommended Posts


Hi all,

I'm trying to access to some buttons inside a toolbar with no luck.

Maybe i'm with the wrong approach or I didn't understand how I can achive this correctly.

I know that If I have a toolbar on a GTK application (eG: gVim), I can access to it's items by getting the handle.

Something like:

#include <GUIToolbar.au3>
$handle = ControlGetHandle("Myapp", "", "[CLASS:someclass; INSTANCE:someinstance]")
_GUICtrlToolbar_ClickIndex($handle, 4)

Most of the win32 apps let me work this way without problems. Now I have to automate a new tool and I can't find the way to access the buttons.

The toolbar looks like this:


>>>> Window <<<<
Title:  MyApp
Class:  ThunderRT6FormDC
Position:   -4, -4
Size:   1374, 746
Style:  0x17CF0000
ExStyle:    0x00000100
Handle: 0x0004025C

>>>> Control <<<<
Class:  Afx:8640000:8:10003:0:0
Instance:   4
ClassnameNN:    Afx:8640000:8:10003:0:04
Advanced (Class):   [CLASS:Afx:8640000:8:10003:0:0; INSTANCE:4]
Text:   Standard
Position:   1, 23
Size:   540, 27
ControlClick Coords:    213, 18
Style:  0x56000100
ExStyle:    0x00000000
Handle: 0x00050262

>>>> Mouse <<<<
Position:   214, 60
Cursor ID:  0
Color:  0xDEDBD6

None of the _GUICtrlToolbar_Click* seem to work, all I get is a click on the upper left of the app.

How would you normally automate this case?

What would you try and why?

All help is welcome,

Thanks in advance!

Share this post

Link to post
Share on other sites

That UDF uses the standard Windows APIs. The Afx class controls don't use the standard Windows APIs and messages, so AutoIt can't interface with them. This is an old problem with window forms and controls that are custom drawn by some tools.


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

It's not the approach I wanted to take but ControlSend() works ok.

Thanks and sorry for the late response.

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  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.