testing1 Posted July 18, 2014 Share Posted July 18, 2014 Hi, Does anyone have an idea if we could use some parameters other than the Instance and position while using ControlClick Commands? Correct me on this: The instance of an object changes everytime you do an action on it? Also what is the best way to use ControlClick command , i.e in such way that the parameters we pass in the command do not change in the app under test. Link to comment Share on other sites More sharing options...
jguinch Posted July 18, 2014 Share Posted July 18, 2014 There is no "best way"... It all depends on the window you're trying to automate. You can use the Advanded Mode (ex: [CLASS:SysListView32; INSTANCE:1]) => Help file : Using AutoIt / Controls Is it for an AutoIt GUI or an external window ? Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF Link to comment Share on other sites More sharing options...
testing1 Posted July 21, 2014 Author Share Posted July 21, 2014 Hi, I am using advanced mode "[CLASS:SysListView32; INSTANCE:1" but looks like this instance changes, am usind a windows app which is built using VC++, is there a way where i could use a parameter that would not change? Link to comment Share on other sites More sharing options...
jguinch Posted July 21, 2014 Share Posted July 21, 2014 Maybe the position of the control, or its size... Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF Link to comment Share on other sites More sharing options...
JohnOne Posted July 21, 2014 Share Posted July 21, 2014 Give the summary tab from window ifo tool. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
testing1 Posted July 22, 2014 Author Share Posted July 22, 2014 Here's the summary: >>>> Window <<<< Title: windowtitle Class: Afx:400000:b:10011:6:85606a7 Position: 317, 103 Size: 648, 514 Style: 0x14CE0000 ExStyle: 0x00000100 Handle: 0x001D0364 >>>> Control <<<< Class: AfxOleControl42 Instance: 1142 ClassnameNN: AfxOleControl421142 Name: Advanced (Class): [CLASS:AfxOleControl42; INSTANCE:1142] ID: Text: Tilt Position: 2, 2 Size: 56, 31 ControlClick Coords: 24, 16 Style: 0x56000000 ExStyle: 0x00000004 Handle: 0x000604DA >>>> Mouse <<<< Position: 26, 18 Cursor ID: 0 Color: 0xC0C0C0 The instance keeps changing for each new action, so advanced mode is of not much help. not understanding which parameters should i fetch so as to get ControlClick working. all help appreciated. Link to comment Share on other sites More sharing options...
jguinch Posted July 22, 2014 Share Posted July 22, 2014 (edited) Are there any other AfxOleControl42 controls in this Window ? What about using just the class ? "[CLASS:AfxOleControl42]" Are you sure that the size and position change everytime ? You can try with "[X:2; Y:2]" or "[W:56; H:31]" Edited July 22, 2014 by jguinch Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF Link to comment Share on other sites More sharing options...
testing1 Posted July 22, 2014 Author Share Posted July 22, 2014 do you mean ControlClick ("title","text", "[X:2, Y:2] OR "[W:56, H:31]") Just tried but no luck Link to comment Share on other sites More sharing options...
testing1 Posted July 22, 2014 Author Share Posted July 22, 2014 All the controls use Class:AfxOleControl42, so unable to use the class too, size doesnt change but the instance does. Link to comment Share on other sites More sharing options...
jguinch Posted July 22, 2014 Share Posted July 22, 2014 Just ControlClick ("title","text", "[W:56, H:31]") ? Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF Link to comment Share on other sites More sharing options...
testing1 Posted July 22, 2014 Author Share Posted July 22, 2014 yes tried ControlClick ("title","text", "[W:56, H:31]" and ControlClick ("title","text", "[X:2, Y:2]" I cant see anything being clicked when i run it. am i missing something basic? or the parameters of our app arent supported? Link to comment Share on other sites More sharing options...
jack71 Posted July 22, 2014 Share Posted July 22, 2014 Not sure if this method will work..., replace windowtitle in the first line with your window title: Local $GetWinHandle = WinList("[CLASS:Afx:400000:b:10011:6:85606a7]", "windowtitle") Local $hWin = $GetWinHandle[1][1] Local $hWinCtrl = ControlGetHandle($HTilt, "Tilt") WinActivate($GetWinHandle) ControlFocus($hWinCtrl, "Tilt") ControlClick($hWinCtrl, "Tilt") 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