Jump to content

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!

Link to comment
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
Link to comment
Share on other sites

  • 1 month later...

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

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...