Jump to content

Any parameters instead of instance and position that could be used?


Recommended Posts

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

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 ?

Link to comment
Share on other sites

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

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

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

 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

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

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
 Share

  • Recently Browsing   0 members

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