Am3oo Posted October 25, 2012 Share Posted October 25, 2012 Hi, I'm new to AutoIt, but not new to automation, although I've been only working with Web pages (Java and Selenium). I'm not sure how to go about selecting any kind of item in the application I want to interact with. Let's say The Window Info tool gives me this (it's a button on a toolbar): >>>> Window <<<< Title: Program - Home Class: TfrmCentral Position: 0, 0 Size: 1268, 768 Style: 0x16CF0000 ExStyle: 0x00050100 Handle: 0x00311762 >>>> Control <<<< Class: TRzBMToolbarButton Instance: 5 ClassnameNN: TRzBMToolbarButton5 Name: Advanced (Class): [CLASS:TRzBMToolbarButton; INSTANCE:5] ID: 1051362 Text: Repositories Position: 5, 144 Size: 69, 68 ControlClick Coords: 40, 43 Style: 0x54010000 ExStyle: 0x00000000 Handle: 0x00100AE2 I've tried: $handler= WinGetHandle("Program - Home"); WinActivate($handler); ;The 2 lines above work and the application is activated on the screen Then: _GUICtrlButton_SetState(1051362,True); Also: _GUICtrlButton_Click(1051362); ;didn't work Also:$item=_WinAPI_GetDlgItem($handler, 0x00100AE2);and with 1051362 _GUICtrlButton_Click($item); ;didn't work Any pointer would be great. Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted October 25, 2012 Moderators Share Posted October 25, 2012 What about this? ControlClick("Program - Home", "", "[CLASS:TRzBMToolbarButton; INSTANCE:5]") Am3oo 1 "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
Am3oo Posted October 25, 2012 Author Share Posted October 25, 2012 (edited) You, sir.. are great! Can I also get the window name when I have certain class name known? (then I'll stop asking these naive questions and only bother you people when I really can't find any documentation about something) Edited October 25, 2012 by Am3oo Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted October 25, 2012 Moderators Share Posted October 25, 2012 Someone who is more knowledgeable than I may wander along and correct me, but I believe you have to include the window title in order for ControlSend to work properly, which would mean knowing the window name. If part of the window title will differ (e.g. Notepad - 123 or Notepad - 456), you can look at WinTitleMatchMode. Am3oo 1 "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
Am3oo Posted October 26, 2012 Author Share Posted October 26, 2012 I've solved that issue with just selecting the class name provided by Window Info for the main window of the application. 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