qaguy Posted January 18, 2010 Share Posted January 18, 2010 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] ID: 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: 0xDEDBD6None 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 More sharing options...
PsaltyDS Posted January 19, 2010 Share Posted January 19, 2010 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 More sharing options...
qaguy Posted January 19, 2010 Author Share Posted January 19, 2010 Can you think of any workaround? Thanks for the answer! Link to comment Share on other sites More sharing options...
PsaltyDS Posted January 19, 2010 Share Posted January 19, 2010 Would it accept accelerator keys, like "!fo" for File|Open? You could try Send()/ControlSend(). 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 More sharing options...
qaguy Posted March 15, 2010 Author Share Posted March 15, 2010 It's not the approach I wanted to take but ControlSend() works ok. Thanks and sorry for the late response. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now