Jump to content
Sign in to follow this  
Iznogoud

Using ControlClick all the way

Recommended Posts

Iznogoud

To start with an image:

Posted Image

How can i use Controlclick to select tabs if they dont have an ID or INSTANCE?

Then second, how can i select an item in a list wich doesn't show me any info in AutoIT window info utility?

I am trying to make a script wich will execute everything in a nice order and i have to be certain that it will do the right thing. I am using now a lot of Send("!.....") commands with alot of Sleep commands, but that isn't the best way to do it.

Could someone help me with this? It has to become fool proof.

Share this post


Link to post
Share on other sites
somdcomputerguy

Some programs can't easily be automated with AutoIt. But try this function, ControlCommand, you might have some luck with it.


- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

Share this post


Link to post
Share on other sites
Iznogoud

hmmmm....that is a good one, i can't get it to work for some reason, but then again, i am not that good.

Can't you select it by using the visible text part?

-edit-

For the record, this is just the screen of the properties of your LAN connection. Only this one is in the dutch language.

Edited by Iznogoud

Share this post


Link to post
Share on other sites
Iznogoud

Nobody knows a other way then using {TAB}, {DOWN}. etc. to select items instead of controlclick?

i can't get the ControlCommand working and tried everything with SysListView like this:

ControlClick("Eigenschappen van LAN-verbinding", "", "[CLASS:SysListView32; TEXT:QoS-pakketplanner; INSTANCE:1]")

But my lack of knowledge is bugging me to get this issue solved, if someone could help me a hand to find the right command i can go further.

Share this post


Link to post
Share on other sites
somdcomputerguy

There's Send and ControlSend.


- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

Share this post


Link to post
Share on other sites
Iznogoud

To be honest, what i want, it can not be done by command line.

I want to modify the properties of the IPv4 settings on the advanced tab, then DNS, and adjust some settings there. This all has to be done on a new created VPN connection.

In other words i am trying to auto create a VPN connection.

But then again, there are alot of places where i find the SysListView and can't click or controlclick it and i was hoping for a good solution.

I will take a look at ControlSend

Share this post


Link to post
Share on other sites
Beege

Are you sure It cant be done by command line? I thought you could change those settings with the "netsh"

Share this post


Link to post
Share on other sites
Iznogoud

you can't send the domain principal name or change not to use the external gateway. Or at least as far as i know and i tried ALOT of things.

Share this post


Link to post
Share on other sites
Beege

I would have look at the command list again for netsh.. I not sure, but find that hard to belive that only some of the network settings can be done.

http://technet.microsoft.com/en-us/library/cc738592(WS.10).aspx#BKMK_1

Share this post


Link to post
Share on other sites
Iznogoud

......

But then again, there are alot of places where i find the SysListView and can't click or controlclick it and i was hoping for a good solution.

I would have look at the command list again for netsh.. I not sure, but find that hard to belive that only some of the network settings can be done.

http://technet.microsoft.com/en-us/library/cc738592(WS.10).aspx#BKMK_1

This is just an example of the control item i encounter, but as you would know there are alot of places where you can't get there by using CLI or REG's

Share this post


Link to post
Share on other sites
Iznogoud

The sitting can't be done by using netsh, so the question stands:

Can i use somekind of command to select a specific line in the SysListView object?

Or someway to read the line, compare it to a specific name if next press {DOWN}, read line again, etc.

Any ideas?

Share this post


Link to post
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
Sign in to follow this  

  • Similar Content

    • Yirrlaar
      By Yirrlaar
      #Include <WinAPI.au3> local $ClassName = _WinAPI_GetClassName(WinGetHandle(WinGetTitle("[ACTIVE]"))) ControlClick(WinGetTitle("[ACTIVE]"), "", "[CLASS:"&$ClassName&"; INSTANCE:1]", "primary") When I am running this script it just gives me a ConsoleWrite output of "0x001D04A8"
      When using "AutoIT v3 Window Info" all the info I need for the ControlClick is there and displayed perfectly as if I typed it in normally.
      Upon click the button it should be clicking it, I see the following inn the console window:
      If I replace the $ClassName with the actual ClassName of "WindowsForms10.BUTTON.app.0.3296db7_r14_ad1" it works just fine, any ideas???
    • Tats
      By Tats
      Hi everyone,
      I have a problem with ControlClick function. It doesn't work no matter how I tried all the possible combination of the parameters.
      Below is the scripts of possible parameter combination:
      ;ControlClick("title","text","controlID ","button","clicks","x","y") ;title= Title, Class, Handle ;controlID= Class, ClassNN, Instance ;Title here is empty when I check it with AutoIt Info ControlClick("", "", "[ScreenKeyboard::Button18]", "left", "1", "230","890") ControlClick("", "", "[CLASS:ScreenKeyboard::Button; INSTANCE:18]", "left", "1", "230","890") ControlClick("", "", "[INSTANCE:18]", "left", "1", "230","890") ;Title here is the Class of the window ControlClick("[ScreenKeyboard::SKFrame]", "", "[ScreenKeyboard::Button18]", "left", "1", "230","890") ControlClick("[ScreenKeyboard::SKFrame]", "", "[CLASS:ScreenKeyboard::Button; INSTANCE:18]", "left", "1", "230","890") ControlClick("[ScreenKeyboard::SKFrame]", "", "[INSTANCE:18]", "left", "1", "230","890") ;Title here is the Handle of the window ControlClick("[0x000907A0]", "", "[ScreenKeyboard::Button18]", "left", "1", "230","890") ControlClick("[0x000907A0]", "", "[CLASS:ScreenKeyboard::Button; INSTANCE:18]", "left", "1", "230","890") ControlClick("[0x000907A0]", "", "[INSTANCE:18]", "left", "1", "230","890") Am I coding it correctly?
      Thanks
    • MaximusCZ
      By MaximusCZ
      Hello, and apologies if this have been discussed before, but I googled and couldnt find anything relevant.
      I have a problem where I try to send a control clink into to a window. 
      Part of window I try to send clicks to looks like this . The black border is showing when I mouse over it Au3Info, I get following information:

      I am testing its interaction with code

      The result I get is that it makes control clicks trough first line, opens and closes menus, as expected.
      When It gets to second line, it does not click a single icon. I can tell that coords are correct as the dropdown menus (No view active) gets focused(altough not rolled out). Same behaviour happens if roughly 40<y<60, so I know I am hitting good height. You can look at how it behaves here: output.webm 
      Dropdown 1 focuses at around 8 sec mark, and 13 sec mark it changes to second dropdown, defocusing first one, seemingly not registering any clinks inbetween.
       
      Have you ever encountered similar behaviour? I need to click the Key button, first on second line, with controlclick (or any other way not hijacking the mouse). I cant trigger that button by keyboard and There is no other control having control over it.
      Help
       
    • Skysnake
      By Skysnake
      I need to automate a specific GUI from a legacy system written in C.
      The spy tool gives me this

      I use this code
      Local $swintit = WinGetTitle("[active]") ConsoleWrite("active Window " & $swintit & @CRLF) If $swintit = "FILES NOTES" Then ; If $swintit = "FILES NOTES" Then ; got Window, now atomate ConsoleWrite("got Window " & @CRLF) ; now focus, then click :) ;EditPaste ;ControlCommand("FILES NOTES", "", 404, $acno) ; paste acno GUICtrlSetState(404, $GUI_Focus) ControlCommand("FILES NOTES", "", 404, $acno) ; paste acno GUICtrlSetState(401, $GUI_Focus) ControlClick("FILES NOTES", "", 401, $acno) ; click okay EndIf ; If $swintit = "FILES NOTES" Then The idea is to paste the acno value into the edit box, then click an Okay button.
      I get a console write that the active Window is as expected, but my loop completes without ever writing anything into the GUI.
      I also tried the control ID as text "404" - same result
      What am I missing?
      Skysnake
       
    • JNutt
      By JNutt
       

       
       
      I'm trying to use mouseclick in a panel above.  I want to click on a list item, such as 'Estimated'.  (I've given up on trying to use control click for this).  I'm using window info coordinates from 'Control' tab.

      ; click 'Columns' WinActivate("Innovaya Studio with Sage (Archtectural 2017_V1.invx") MouseClick("primary", 292, 88, 1, 1) WinActivate("Select Browsing Properties") Sleep(1000) MouseClick("primary", 27, 70, 0,0) Sleep(2000) Send("{TAB}{TAB}{TAB}{TAB}{TAB}") Sleep(1000) Send("{ENTER}") ControlClick( But when I used the code Autoit doesn't click where the coordinates are.  In the scipts it is the second MouseClick that won't work.  Any ideas?
×