ryanbogadi Posted August 31, 2005 Share Posted August 31, 2005 How do I go about using all of these "control" functions to click and send to various controls? I know about the help file, and I know that this is the basic format for ControlClick: ControlClick ( "title", "text", controlID [, button] [, clicks]] ) But what I don't understand is how to specify what part of the control to click. I used the AU3Info.exe to get the name of the control, but it seems to consider the whole toolbar, for example, to be one big control. So if I use something like this ControlClick("AutoIt3","","ToolbarWindow323") it just clicks the button at the end of that toolbar (in this case, Views). So if I wanted to tell it to click the refresh button on the toolbar, how do I do that? Are these controls broken down into smaller controls? Any help is appreciated. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted August 31, 2005 Moderators Share Posted August 31, 2005 You could always use MouseClick() if the Control doesn't have any Text to specify its location or if it doesn't have a unique Control ID / ClassNameNN. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
anyday Posted August 31, 2005 Share Posted August 31, 2005 toolbars to my understanding do not have individual controls, i would suggest the moustclick function Link to comment Share on other sites More sharing options...
AutoChris Posted August 31, 2005 Share Posted August 31, 2005 Also, depending on the button you want to click, you can do a PixelSearch() to get the color of the toolbar pic to click. That usually works for me when I am waiting for the "Stop" button on IE to go red. Link to comment Share on other sites More sharing options...
quaizywabbit Posted August 31, 2005 Share Posted August 31, 2005 (edited) have a look here under the "ToolBar Control Reference/Messages"using DllCall to 'SendMessage" you could do quite a bit with a toolbar control.Since Toolbars aren't part of AutoIt's Gui creation set yet, I'm not aware of any specific UDF's that deal with them. Edited August 31, 2005 by quaizywabbit [u]Do more with pre-existing apps![/u]ANYGUIv2.8 Link to comment Share on other sites More sharing options...
LxP Posted September 1, 2005 Share Posted September 1, 2005 Toolbars generally just duplicate the options available via a program's menu bar. You may find the WinMenuSelectItem() function quite useful for your purposes. Link to comment Share on other sites More sharing options...
ryanbogadi Posted September 1, 2005 Author Share Posted September 1, 2005 I guess my initial post was a bit misleading. The application I'm trying to create will not be clicking things in the toolbar (except for a couple of instances in which I just use MouseClick). I just thought that the toolbar would be a good general example of what I'm talking about. But in the real application, the controls are inside the window, and they are not always in the same place for every user. Up until now I have used calibration to force the users to locate the controls, then use MouseClick. But I'm really hoping that this can be done without the calibration step, and the only way to do that (that I can think of) is by using the Control functions. So, when I run AU3Info.exe, it finds controls in this window. For example, the data header row is treated as one long control. And the group of page-scrolling buttons is another control. But if I want to click on an individual cell in the data header row, or an individual button from the page-scrollng group, how do I do that? Is there a way to indicate coordinates within a control (like say "click control X at 100,100")? Again, any help is appreciated. Link to comment Share on other sites More sharing options...
MHz Posted September 1, 2005 Share Posted September 1, 2005 Hi ryanbogadi, Controls are buttons, checkboxes etc. AutoIt works with a control quite differently as to a mouseclick. AutoIt just needs the ControlID to click it, where as a mouseclick needs coordinates. If you know this, good. That is why Control* functions are more reliable. You tell AutoIt to click "button1", and it clicks on it. Now, the basic rule is, that if AutoItInfo cannot retrieve the ControlID, then AutoIT cannot see it. So, in response to your last question. Control functions do not use coordinates. ControlGetPos is the only Control function that deals with coordinates, but that is the get coordinates of a control. 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