Jump to content
JNutt

WindowInfo - control ID

Recommended Posts

Earthshine

please insert code between code tags <>

like so

;~ *** Standard code maintainable ***
#include "UIAWrappers.au3"
AutoItSetOption("MustDeclareVars", 1)

_UIA_setVar("oP1","Title:=Innovaya Studio;controltype:=UIA_WindowControlTypeId;class:=WindowsForms10.Window.8.app.0.1e84ccb_r16_ad1")    ;Innovaya Studio
_UIA_setVar("oP2","Title:=panelMRF;controltype:=UIA_PaneControlTypeId;class:=WindowsForms10.Window.8.app.0.1e84ccb_r16_ad1")    ;panelMRF
_UIA_setVar("oP3","Title:=panelOpenExit;controltype:=UIA_PaneControlTypeId;class:=WindowsForms10.Window.8.app.0.1e84ccb_r16_ad1")    ;panelOpenExit

_UIA_setVar("Open.mainwindow","title:=Open;classname:=WindowsForms10.Window.b.app.0.1e84ccb_r16_ad1")

;~ Actions split away from logical/technical definition above can come from configfiles 

;~_UIA_Action("oP1","highlight")
_UIA_Action("oP1","setfocus")
;~_UIA_Action("oP2","highlight")
_UIA_Action("oP2","setfocus")
;~_UIA_Action("oP3","highlight")
_UIA_Action("oP3","setfocus")

_UIA_action("Open.mainwindow","setfocus")

see if that code sets focus on the element you care about. Once you get your setVar right you can use a variety of Actions on it. Look at the functions in the UIAWrappers.au3 for methods you can use to get/set text and whatnot.

Edited by Earthshine

My resources are limited. You must ask the right questions

 

Share this post


Link to post
Share on other sites
JNutt
12 minutes ago, Earthshine said:

please insert code between code tags <>

like so

;~ *** Standard code maintainable ***
#include "UIAWrappers.au3"
AutoItSetOption("MustDeclareVars", 1)

_UIA_setVar("oP1","Title:=Innovaya Studio;controltype:=UIA_WindowControlTypeId;class:=WindowsForms10.Window.8.app.0.1e84ccb_r16_ad1")    ;Innovaya Studio
_UIA_setVar("oP2","Title:=panelMRF;controltype:=UIA_PaneControlTypeId;class:=WindowsForms10.Window.8.app.0.1e84ccb_r16_ad1")    ;panelMRF
_UIA_setVar("oP3","Title:=panelOpenExit;controltype:=UIA_PaneControlTypeId;class:=WindowsForms10.Window.8.app.0.1e84ccb_r16_ad1")    ;panelOpenExit

_UIA_setVar("Open.mainwindow","title:=Open;classname:=WindowsForms10.Window.b.app.0.1e84ccb_r16_ad1")

;~ Actions split away from logical/technical definition above can come from configfiles 

;~_UIA_Action("oP1","highlight")
_UIA_Action("oP1","setfocus")
;~_UIA_Action("oP2","highlight")
_UIA_Action("oP2","setfocus")
;~_UIA_Action("oP3","highlight")
_UIA_Action("oP3","setfocus")

_UIA_action("Open.mainwindow","setfocus")

see if that code sets focus on the element you care about. Once you get your setVar right you can use a variety of Actions on it. Look at the functions in the UIAWrappers.au3 for methods you can use to get/set text and whatnot.

Thanks.  Are you saying to insert this code in my original script?  And then if it sets the focus on the element to  use functions in UIAWrappers? 

I probably need to understand/learn more about what simplyspy is doing.

Share this post


Link to post
Share on other sites
rcmaehl

-snip-

Issue was already resolved

Edited by rcmaehl

My UDFs are generally for me. If they aren't updated for a while, it means I'm not using them myself. As soon as I start using them again, they'll get updated.

MY PROJECTS


Active: IRC UDF, WindowEx UDF
Discontinued: GithubBubbleSort UDF

Share this post


Link to post
Share on other sites
Earthshine

Just use that code in a test file and run it. Tell us what happens 


My resources are limited. You must ask the right questions

 

Share this post


Link to post
Share on other sites
JNutt

Whats the purpose of the <> tags?  If I wrap the code in '<>' I get an error. 

If i run the code without '<>' the only thing that happens is a red box is around the Scite editor.  The output pane shows this:

>"C:\Program Files (x86)\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "C:\autoit3\other.au3"    
  deep find in subtree oP1;Desktop
  deep find in subtree oP2;Desktop
  deep find in subtree oP3;Desktop
>Exit code: 0    Time: 9.262
 

Edited by JNutt

Share this post


Link to post
Share on other sites
Bilgus

Untitled.png.720772a2e338445efdabbe3a8b8908f8.png

the code tags are only for on the forum              ^ between the '' and smiley faces

Edited by Bilgus
  • Thanks 1

Share this post


Link to post
Share on other sites
JNutt
On 3/20/2018 at 3:43 PM, Earthshine said:

Just use that code in a test file and run it. Tell us what happens 

When I run the code nothing happens.  I assume if it worked the button I was after would hightlight?

Share this post


Link to post
Share on other sites
JNutt
5 minutes ago, JNutt said:

When I run the code nothing happens.  I assume if it worked the button I was after would hightlight?

When I use simplyspy.au3I on different buttons (one app) I get same exact info.  Can simplyspy give me details about a specific button?

 

Share this post


Link to post
Share on other sites
Earthshine

It gets every element it can see. It should have setFocus in it. Uncomment out the highlight action and see if it highlights 

Edited by Earthshine

My resources are limited. You must ask the right questions

 

Share this post


Link to post
Share on other sites
JNutt
8 hours ago, Earthshine said:

It gets every element it can see. It should have setFocus in it. Uncomment out the highlight action and see if it highlights 

I really appreciate your help Earthshine. 

When I run it the code the different options will hightlighte the Scite editor and part of the taskbar, but not the app I want it to.  Should the Output panel show me anthing?  Below is the what I see in the output:

>"C:\Program Files (x86)\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "C:\Program Files (x86)\AutoIt3\bin\open_button.au3"    
  deep find in subtree oP1;Desktop
  deep find in subtree oP2;Desktop
  deep find in subtree oP3;Desktop
  deep find in subtree oP3;Desktop
>Exit code: 0    Time: 10.82
 

  • Like 1

Share this post


Link to post
Share on other sites
Earthshine

you don't need to quote all our posts mate. we know what we've said. so, you run simplespy.au3, then, go clickk on the app you care about. THEN press CTRL-W keys and the code should go right to the simplespy... example I just captured VMware

;~ *** Standard code Flexible***
#include "UIAWrappers.au3"
AutoItSetOption("MustDeclareVars", 1)

Local $oP1=_UIA_getObjectByFindAll($UIA_oDesktop, "Title:=2008r2 - VMware Workstation;controltype:=UIA_WindowControlTypeId;class:=VMUIFrame", $treescope_children)  
_UIA_Action($oP1,"setfocus")
Local $oP0=_UIA_getObjectByFindAll($oP1, "Title:=;controltype:=UIA_PaneControlTypeId;class:=vmware.fullScreenToolbar", $treescope_children) 
_UIA_Action($oP0,"setfocus")
_UIA_setVar("vmFullScreenUnibar.mainwindow","title:=vmFullScreenUnibar;classname:=wui.unibar.Bar")
_UIA_action("vmFullScreenUnibar.mainwindow","setfocus")

 

Edited by Earthshine

My resources are limited. You must ask the right questions

 

Share this post


Link to post
Share on other sites
Earthshine

so run simplespy, then click on your app, bring it to front and focus, then press the CTRL-W keys together to capture your code. then, in the UIAWrappers.au3 you can see all the things you can do with the _UIA_Action method including 'getValue' 'setValue' (several of those, different types) and 'click'

Edited by Earthshine

My resources are limited. You must ask the right questions

 

Share this post


Link to post
Share on other sites
JNutt

Thanks.  I get the code from simplyspy,  but when I put it in an editor, uncomment out the different _UIA_Action highlight and run it it never highlights the button I'm trying to click. 

Also, I'm a little confused.  When I look at the first line I see info about the Open button I want to click.  but the _UIA_Actions for oP1-oP3 are for the parent page. 

My original issue is that if I run the script I get the first line to run which starts the app, but the next line doesn't run (which is code to click a button).  But if I first start the app manually, without the 'Run' command to start app, and then run controlclick I works with no issues.

 

Heres the code form simplyspy:

<Having the following values for all properties:
Title is: <Open>    Class   := <WindowsForms10.Window.b.app.0.1e84ccb_r16_ad1>    controltype:= <UIA_ButtonControlTypeId>    ,<50000>    , (0000C350)    9;65;131;63
*** Parent Information top down ***
2: Title is: <Innovaya Studio>    Class   := <WindowsForms10.Window.8.app.0.1e84ccb_r16_ad1>    controltype:= <UIA_WindowControlTypeId>    ,<50032>    , (0000C370)    -8;-8;1616;876
"Title:=Innovaya Studio;controltype:=UIA_WindowControlTypeId;class:=WindowsForms10.Window.8.app.0.1e84ccb_r16_ad1""
1: Title is: <panelMRF>    Class   := <WindowsForms10.Window.8.app.0.1e84ccb_r16_ad1>    controltype:= <UIA_PaneControlTypeId>    ,<50033>    , (0000C371)    0;55;1600;805
"Title:=panelMRF;controltype:=UIA_PaneControlTypeId;class:=WindowsForms10.Window.8.app.0.1e84ccb_r16_ad1""
0: Title is: <panelOpenExit>    Class   := <WindowsForms10.Window.8.app.0.1e84ccb_r16_ad1>    controltype:= <UIA_PaneControlTypeId>    ,<50033>    , (0000C371)    2;57;143;801
"Title:=panelOpenExit;controltype:=UIA_PaneControlTypeId;class:=WindowsForms10.Window.8.app.0.1e84ccb_r16_ad1""
>

Share this post


Link to post
Share on other sites
JNutt

Here is the script I'm trying to run:

<

AutoItSetOption('MouseCoordMode', 0)
AutoItSetOption('SendKeyDelay', 10)

;Start Innovaya Studio
Run("c:\Program Files\Innovaya\R4\inv5d.exe", "", @SW_MAXIMIZE)

WinWaitActive('Innovaya Studio')
ControlClick('Innovaya Studio', '', "[NAME:butOpenInv]")

>

Share this post


Link to post
Share on other sites
Bilgus

There is probably another window that has the name prior to it being fully started what about adding a Sleep(10000)  between run and winwait?

 

  • Thanks 1

Share this post


Link to post
Share on other sites
JNutt

That was it!  There was a splash screen.

Side note.  The autoIT forum has been great and the help docs also, but its hard to get an abstract understanding of whats going on.  I have no windows programming knowledge.  Its hard to get a mental picture of whats going on.

Anyway, Thanks for the help!

  • Like 1

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

  • Similar Content

    • Rammanan
      By Rammanan
      Hi all, Below is my script,
      Pls advise me if any wrong on that....File exit in location but the return -1.
      FileOpen($file, 0)
         $line = FileReadLine($file)
         MsgBox(0,'',$line)
      FileClose($file)
      Local $aArray = _FileListToArrayRec($serverpath, "*|*.txt", $FLTAR_FILES, $FLTAR_RECUR, $FLTAR_SORT, $FLTAR_NOPATH)
      If @error Then
              MsgBox($MB_SYSTEMMODAL, "Ooops!", "No files found")
          Else
          ;_ArrayDisplay($aArray, "Sorted tree")
                 Local $hSearch = FileFindFirstFile($line)
               MsgBox(0,'',$hSearch)
       
    • Theodoor
      By Theodoor
      Hi,
      I am trying to use the ControlClick in a "save as"-window to select the path of where to save the document.
      I found out that when in press the icon in front of the path, i select the path. So I am trying to press that button (i have attached a print screen of this window).
      While trying to figure out how i had to use the ControlClick, it said somewhere that i could us Au3Info to find out what title,... i should use with the ControlClick.
      The result of the Au3Info I have attached aswel.
      The ControlClick that i tried are these: (and none of these even move the mouse)
      ControlClick("[CLASS:ToolbarWindow32; INSTANCE:4]", "", "", "Left" ,1 ,10,10)
      ControlClick("[CLASS:ToolbarWindow32; INSTANCE:4]", "", "1001", "Left" ,1 ,10,10)
      ControlClick("[CLASS:ToolbarWindow32]", "", "", "Left" ,1 ,10,10)
      ControlClick("Save project as", "", "", "Left" ,1 ,10,10)
      I don't know what I am doing wrong.
      Should I use a controlID? is my windowtitle wrong?
      Can anyone help me?
      Thanks in advance,
      Theo


    • Trisha
      By Trisha
      I tried (using AutoIt) to automate a scenario where i  have to open IE with specific URL on my extranet(Xen Desktop or Citrix ) ,from there i need to download  file and then through WinSCP; I  have to move that file to another location that can be access from my Local system using VMWare.
      I did as far as the above step. Now i want to navigate from my extranet to my local desktop system. But i am not able to move  from there.Mouse click is also not working.Please find the below screenshot highlighted in YELLOW.
       


    • CYCho
      By CYCho
      Browsers seem to have a built-in feature to insert a check box (Prevent this page from creating additional dialogues) into the message box created by an web site. This check box seems to appear when the same message box is triggered in succession within a short span of time. My problem is that AutoIt cannot read the text of the IE11 message box when this check box is included. I started to experence this after my Windows 10 was updated to Anniversay Update. I would like to know if anyone has experienced the same thing and if there is a solution to let the AutoIt read the text.
    • PauloRodrigues
      By PauloRodrigues
      I need to select an item from a SAP combobox, could anyone help me or did something like that? I tried to use some AutoIt functions but without success.
      When i try to identify the combobox with au3Info, this is the return:


      Could anyone help me with this challange?
×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.