Jump to content

WindowInfo - control ID


 Share

Recommended Posts

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

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

-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

WhyNotWin11
Cisco FinesseGithubIRC UDFWindowEx UDF

 

Link to comment
Share on other sites

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

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?

Link to comment
Share on other sites

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?

 

Link to comment
Share on other sites

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
 

Link to comment
Share on other sites

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

 

Link to comment
Share on other sites

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

 

Link to comment
Share on other sites

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""
>

Link to comment
Share on other sites

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]")

>

Link to comment
Share on other sites

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!

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

×
×
  • Create New...