Jump to content

Recommended Posts

Posted
32 minutes ago, LarsJ said:

TheDcoder, This is not the correct link to documentation.

Oops, sorry, I should have been more careful. Pardon my knowledge of Automation and WinAPI, I suck at both :>

EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time)

DcodingTheWeb Forum - Follow for updates and Join for discussion

Posted

ttf16.ocx is something very old. Any reference you have to the supplier of this controls

vsflexgrid is similar question but you probably will have more luck on that one if you can find the supplier.

Whats the application you are trying to automate and is it inhouse developed or no access to the sourcecode / developers of the application.

Posted (edited)

Mouse position is retrieved 556-234
At least we have an element title: [] class: [TTF16.WndClass]Having the following values for all properties: 

Title is: <>    Class   := <TTF16.WndClass>    controltype:= <UIA_PaneControlTypeId>    ,<50033>    , (0000C371)    204;69;1236;777
*** Parent Information top down ***
7: Title is: <User333-中联医院信息系统(旗舰版)-检验信息系统>    Class   := <ThunderRT6FormDC>    controltype:= <UIA_WindowControlTypeId>    ,<50032>    , (0000C370)    -4;-4;1448;878
"Title:=User333-中联医院信息系统(旗舰版)-检验信息系统;controltype:=UIA_WindowControlTypeId;class:=ThunderRT6FormDC""    
6: Title is: <新版住院护士工作站(当前用户:User333)>    Class   := <ThunderRT6FormDC>    controltype:= <UIA_WindowControlTypeId>    ,<50032>    , (0000C370)    -4;-4;1448;878
"Title:=新版住院护士工作站(当前用户:User333);controltype:=UIA_WindowControlTypeId;class:=ThunderRT6FormDC""    
5: Title is: <病人事务处理 - 护理病历(当前用户:User333)>    Class   := <ThunderRT6FormDC>    controltype:= <UIA_WindowControlTypeId>    ,<50032>    , (0000C370)    -4;-4;1448;878
"Title:=病人事务处理 - 护理病历(当前用户:User333);controltype:=UIA_WindowControlTypeId;class:=ThunderRT6FormDC""    
4: Title is: <>    Class   := <AfxOleControl42>    controltype:= <UIA_PaneControlTypeId>    ,<50033>    , (0000C371)    0;153;1440;693
"Title:=;controltype:=UIA_PaneControlTypeId;class:=AfxOleControl42""    
3: Title is: <Form1(当前用户:User333)>    Class   := <ThunderRT6FormDC>    controltype:= <UIA_PaneControlTypeId>    ,<50033>    , (0000C371)    0;177;1440;669
"Title:=Form1(当前用户:User333);controltype:=UIA_PaneControlTypeId;class:=ThunderRT6FormDC""    
2: Title is: <(NOSIE)评定记录>    Class   := <ThunderRT6FormDC>    controltype:= <UIA_WindowControlTypeId>    ,<50032>    , (0000C370)    -4;-4;1448;878
"Title:=(NOSIE)评定记录;controltype:=UIA_WindowControlTypeId;class:=ThunderRT6FormDC""    
1: Title is: <>    Class   := <Afx:2180000:8:10011:0:0>    controltype:= <UIA_PaneControlTypeId>    ,<50033>    , (0000C371)    204;69;1236;777
"Title:=;controltype:=UIA_PaneControlTypeId;class:=Afx:2180000:8:10011:0:0""    
0: Title is: <>    Class   := <ThunderRT6PictureBoxDC>    controltype:= <UIA_PaneControlTypeId>    ,<50033>    , (0000C371)    204;69;1236;777
"Title:=;controltype:=UIA_PaneControlTypeId;class:=ThunderRT6PictureBoxDC""    


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

_UIA_setVar("oP1","Title:=User333-中联医院信息系统(旗舰版)-检验信息系统;controltype:=UIA_WindowControlTypeId;class:=ThunderRT6FormDC")    ;User333-中联医院信息系统(旗舰版)-检验信息系统
_UIA_setVar("oP2","Title:=新版住院护士工作站(当前用户:User333);controltype:=UIA_WindowControlTypeId;class:=ThunderRT6FormDC")    ;新版住院护士工作站(当前用户:User333)
_UIA_setVar("oP3","Title:=病人事务处理 - 护理病历(当前用户:User333);controltype:=UIA_WindowControlTypeId;class:=ThunderRT6FormDC")    ;病人事务处理 - 护理病历(当前用户:User333)
_UIA_setVar("oP4","Title:=;controltype:=UIA_PaneControlTypeId;class:=AfxOleControl42")    ;
_UIA_setVar("oP5","Title:=Form1(当前用户:User333);controltype:=UIA_PaneControlTypeId;class:=ThunderRT6FormDC")    ;Form1(当前用户:User333)
_UIA_setVar("oP6","Title:=(NOSIE)评定记录;controltype:=UIA_WindowControlTypeId;class:=ThunderRT6FormDC")    ;(NOSIE)评定记录
_UIA_setVar("oP7","Title:=;controltype:=UIA_PaneControlTypeId;class:=Afx:2180000:8:10011:0:0")    ;
_UIA_setVar("oP8","Title:=;controltype:=UIA_PaneControlTypeId;class:=ThunderRT6PictureBoxDC")    ;

_UIA_setVar(".mainwindow","title:=;classname:=TTF16.WndClass")

;~ 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("oP4","highlight")
_UIA_Action("oP4","setfocus")
;~_UIA_Action("oP5","highlight")
_UIA_Action("oP5","setfocus")
;~_UIA_Action("oP6","highlight")
_UIA_Action("oP6","setfocus")
;~_UIA_Action("oP7","highlight")
_UIA_Action("oP7","setfocus")
;~_UIA_Action("oP8","highlight")
_UIA_Action("oP8","setfocus")

_UIA_action(".mainwindow","setfocus")


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

Local $oP7=_UIA_getObjectByFindAll($UIA_oDesktop, "Title:=User333-中联医院信息系统(旗舰版)-检验信息系统;controltype:=UIA_WindowControlTypeId;class:=ThunderRT6FormDC", $treescope_children)    
_UIA_Action($oP7,"setfocus")
Local $oP6=_UIA_getObjectByFindAll($oP7, "Title:=新版住院护士工作站(当前用户:User333);controltype:=UIA_WindowControlTypeId;class:=ThunderRT6FormDC", $treescope_children)    
_UIA_Action($oP6,"setfocus")
Local $oP5=_UIA_getObjectByFindAll($oP6, "Title:=病人事务处理 - 护理病历(当前用户:User333);controltype:=UIA_WindowControlTypeId;class:=ThunderRT6FormDC", $treescope_children)    
_UIA_Action($oP5,"setfocus")
Local $oP4=_UIA_getObjectByFindAll($oP5, "Title:=;controltype:=UIA_PaneControlTypeId;class:=AfxOleControl42", $treescope_children)    
_UIA_Action($oP4,"setfocus")
Local $oP3=_UIA_getObjectByFindAll($oP4, "Title:=Form1(当前用户:User333);controltype:=UIA_PaneControlTypeId;class:=ThunderRT6FormDC", $treescope_children)    
_UIA_Action($oP3,"setfocus")
Local $oP2=_UIA_getObjectByFindAll($oP3, "Title:=(NOSIE)评定记录;controltype:=UIA_WindowControlTypeId;class:=ThunderRT6FormDC", $treescope_children)    
_UIA_Action($oP2,"setfocus")
Local $oP1=_UIA_getObjectByFindAll($oP2, "Title:=;controltype:=UIA_PaneControlTypeId;class:=Afx:2180000:8:10011:0:0", $treescope_children)    
_UIA_Action($oP1,"setfocus")
Local $oP0=_UIA_getObjectByFindAll($oP1, "Title:=;controltype:=UIA_PaneControlTypeId;class:=ThunderRT6PictureBoxDC", $treescope_children)    
_UIA_Action($oP0,"setfocus")
_UIA_setVar(".mainwindow","title:=;classname:=TTF16.WndClass")
_UIA_action(".mainwindow","setfocus")


*** Detailed properties of the highlighted element ***
UIA_class:= <TTF16.WndClass>
UIA_regexpclass:= <TTF16.WndClass>
UIA_iaccessiblechildId:= <0>
UIA_handle:= <67808>
UIA_RuntimeId:= <42;67808>
UIA_BoundingRectangle:= <204;69;1236;777>
UIA_ProcessId:= <468>
UIA_ControlType:= <50033>
UIA_LocalizedControlType:= <窗格>
UIA_HasKeyboardFocus:= <True>
UIA_IsKeyboardFocusable:= <True>
UIA_IsEnabled:= <True>
UIA_ClassName:= <TTF16.WndClass>
UIA_Culture:= <0>
UIA_IsControlElement:= <True>
UIA_IsContentElement:= <True>
UIA_IsPassword:= <False>
UIA_NativeWindowHandle:= <67808>
UIA_IsOffscreen:= <False>
UIA_Orientation:= <0>
UIA_FrameworkId:= <Win32>
UIA_IsRequiredForForm:= <False>
UIA_IsDockPatternAvailable:= <False>
UIA_IsExpandCollapsePatternAvailable:= <False>
UIA_IsGridItemPatternAvailable:= <False>
UIA_IsGridPatternAvailable:= <False>
UIA_IsInvokePatternAvailable:= <False>
UIA_IsMultipleViewPatternAvailable:= <False>
UIA_IsRangeValuePatternAvailable:= <False>
UIA_IsScrollPatternAvailable:= <False>
UIA_IsScrollItemPatternAvailable:= <False>
UIA_IsSelectionItemPatternAvailable:= <False>
UIA_IsSelectionPatternAvailable:= <False>
UIA_IsTablePatternAvailable:= <False>
UIA_IsTableItemPatternAvailable:= <False>
UIA_IsTextPatternAvailable:= <False>
UIA_IsTogglePatternAvailable:= <False>
UIA_IsTransformPatternAvailable:= <False>
UIA_IsValuePatternAvailable:= <False>
UIA_IsWindowPatternAvailable:= <False>
UIA_ValueIsReadOnly:= <True>
UIA_RangeValueValue:= <0>
UIA_RangeValueIsReadOnly:= <True>
UIA_RangeValueMinimum:= <0>
UIA_RangeValueMaximum:= <0>
UIA_RangeValueLargeChange:= <0>
UIA_RangeValueSmallChange:= <0>
UIA_ScrollHorizontalScrollPercent:= <0>
UIA_ScrollHorizontalViewSize:= <100>
UIA_ScrollVerticalScrollPercent:= <0>
UIA_ScrollVerticalViewSize:= <100>
UIA_ScrollHorizontallyScrollable:= <False>
UIA_ScrollVerticallyScrollable:= <False>
UIA_SelectionCanSelectMultiple:= <False>
UIA_SelectionIsSelectionRequired:= <False>
UIA_GridRowCount:= <0>
UIA_GridColumnCount:= <0>
UIA_GridItemRow:= <0>
UIA_GridItemColumn:= <0>
UIA_GridItemRowSpan:= <1>
UIA_GridItemColumnSpan:= <1>
UIA_DockDockPosition:= <5>
UIA_ExpandCollapseExpandCollapseState:= <3>
UIA_MultipleViewCurrentView:= <0>
UIA_WindowCanMaximize:= <False>
UIA_WindowCanMinimize:= <False>
UIA_WindowWindowVisualState:= <0>
UIA_WindowWindowInteractionState:= <0>
UIA_WindowIsModal:= <False>
UIA_WindowIsTopmost:= <False>
UIA_SelectionItemIsSelected:= <False>
UIA_TableRowOrColumnMajor:= <2>
UIA_ToggleToggleState:= <2>
UIA_TransformCanMove:= <False>
UIA_TransformCanResize:= <False>
UIA_TransformCanRotate:= <False>
UIA_IsLegacyIAccessiblePatternAvailable:= <True>
UIA_LegacyIAccessibleChildId:= <0>
UIA_LegacyIAccessibleRole:= <10>
UIA_LegacyIAccessibleState:= <1048580>
UIA_IsDataValidForForm:= <False>
UIA_ProviderDescription:= <[pid:3036,hwnd:0x108E0 Main:Nested [pid:468,hwnd:0x108E0 Annotation(parent link):Microsoft: Annotation Proxy (unmanaged:uiautomationcore.dll); Main:Microsoft: MSAA Proxy (unmanaged:uiautomationcore.dll)]; Nonclient:Microsoft: Non-Client Proxy (unmanaged:uiautomationcore.dll); Hwnd(parent link):Microsoft: HWND Proxy (unmanaged:uiautomationcore.dll)]>
UIA_IsItemContainerPatternAvailable:= <False>
UIA_IsVirtualizedItemPatternAvailable:= <False>
UIA_IsSynchronizedInputPatternAvailable:= <False>

Ttf16 control in the window
On the right side of the picture

ttf16.jpg

I need to fill in a lot of data every day
I want to use OBJGET ()
But always shows an error
What is the third parameter of OBJGET?
Thank you

Edited by JLogan3o13
Posted

Hello again, sorry for my newbie question but am I doing it right?:

_UIA_getObjectByFindAll($oP0, "title:=;ControlType:=UIA_ButtonControlTypeId;UIA_HelpText:=MODIFY SETTINGS;UIA_IsOffscreen:=False", $treescope_subtree)

I am trying to target a specific button (it acts more like a tab) but the default code generated by simple spy is not enough so I added 2 new properties, "UIA_HelpText" and "UIA_IsOffscreen". I got both of those values from simple spy.

The first property targets the help text (which is displayed if you hover your mouse over the button) and the second one targets a control which is not off-screen... The first property is unique but when I tried it without the IsOffscreen property, it didn't work :(. It was highlighting a "invisible" control, I couldn't see it but it is in the middle of the window... obviously off screen so I decided to add the Offscreen property and tried it again. Still no luck, now I am doubting myself, am I doing it right?

Thanks for the help in advance :)

EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time)

DcodingTheWeb Forum - Follow for updates and Join for discussion

Posted

@eqjtlm these controls are from VB6 previous century build. Only if you see a small area / cell highlighting with simplespy you could try with a combination of sendkeys but otherwise its hard to tell how to deal with this exactly

 

@TheDcoder Am I doing it right? is a weird question if its not working  :D title:= with nothing behind it then you can leave it away.  
From all properties you must leave away the UIA_ prefix.  see uiawrappers $UIA_propertiesSupportedArray

["HelpText", $UIA_HelpTextPropertyId], _
["IsOffscreen", $UIA_IsOffscreenPropertyId], _

 

Posted (edited)
49 minutes ago, junkew said:

Am I doing it right? is a weird question if its not working  :D

:>

49 minutes ago, junkew said:

title:= with nothing behind it then you can leave it away.

:o! I didn't notice it, thanks :D

49 minutes ago, junkew said:

From all properties you must leave away the UIA_ prefix.  see uiawrappers $UIA_propertiesSupportedArray

$UIA_propertiesSupportedArray is really useful, thanks for the information, now I can automate things properly :)

Update: It worked! :thumbsup:

Edited by TheDcoder
Added update

EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time)

DcodingTheWeb Forum - Follow for updates and Join for discussion

Posted
1 hour ago, junkew said:

@eqjtlm  这些控件来自上个世纪VB6版本。只有当你看到一个小区域/单元格突出显示simplespy,你可以尝试与sendkeys的组合,但否则很难说如何处理这个

 

@TheDcoder  我做的对吗? 是一个奇怪的问题,如果它不工作的   :D 标题:=没有任何背后,那么你可以离开它。  
从所有的属性,你必须  离开UIA_前缀。看uiawrappers $ UIA_propertiesSupportedArray

[ “HelpText” , $ UIA_HelpTextPropertyId ]_ 
[ “IsOffscreen” , $ UIA_IsOffscreenPropertyId ]_

 

With sendkey I have long been doing, but one by one input data, very slow, although not use your code, I am still very grateful to your answer! :)

Posted

Hello, I have another noob question, I think I am being lazy here but I am really confused. Can you point me to a example which show how I can loop through the objects/elements/controls inside a parent object/element/control? I am trying to detect a piece of text inside a "pane", I was planning to match every element's title with a set of predefined title texts and if the text matches one of the titles, I will check if its off-screen or not and if it is not off-screen I need to capture the title and return it.

Thank you for the answer in advance :)

EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time)

DcodingTheWeb Forum - Follow for updates and Join for discussion

Posted

example 1 where you can see with treewalkers how to walk thru the tree from a certain object (root is desktop)

In the UIAWrappers in functions with find you can see how it works

Be aware on the parameter that controls the number of childs you get and how many levels deep.
All descendants inculding all grandgrandgrand childs is a time consuming job.

Posted

Thanks, I will look into the example :).

5 minutes ago, junkew said:

Be aware on the parameter that controls the number of childs you get and how many levels deep.
All descendants inculding all grandgrandgrand childs is a time consuming job.

I only need to go 1 level deep, I don't need any grand children :P

EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time)

DcodingTheWeb Forum - Follow for updates and Join for discussion

Posted

then reading thru this function in uiawrappers

;~ Just dumps all information under a certain object
Func _UIA_DumpThemAll($oElementStart, $treeScope)

together with example 1 would give you the solution

The array of elements is for most people the easiest as they then just can loop with a for/next construction

  • 4 weeks later...
Posted

Hello, can anyone have a look at this question that I posted at StackOverflow?: https://stackoverflow.com/questions/43841450/uiautomation-wont-work-in-a-vps-if-i-am-not-connected-via-rdp

I know that it is not encouraged to link to questions on other sites but I thought it would be more suited there than here at the AutoIt Forum... I have tried many things since I asked that question but none worked, I am very desperate to get to the bottom of this hence I wrote this post :).

P.S I asked that at 8th of May

EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time)

DcodingTheWeb Forum - Follow for updates and Join for discussion

  • 2 weeks later...
Posted (edited)

Hi all,

I'm having hard time trying to simply pass text or button clicks to a Qwidget, I'm not a programmer but I know how to use Autoit

I've found this thread and I'm using SimpleSpy to get a simple code to interact with my Qwidget

Unfortunately I can't focus the windows with the code provided, this is strange, the script is just hanging...

In this example I have open an "Open File" window inside the Qwidget this is why I have #32770 class window
 

#include "UIAWrappers.au3"
AutoItSetOption("MustDeclareVars", 1)

_UIA_setVar("oP1","Title:=CLO Enterprise OnlineAuth;controltype:=UIA_PaneControlTypeId;class:=QWidget")    ;CLO Enterprise OnlineAuth
_UIA_setVar("oP2","Title:=Open File;controltype:=UIA_WindowControlTypeId;class:=#32770")    ;Open File

;~ $oUIElement=_UIA_getObjectByFindAll(".mainwindow", "title:=;ControlType:=UIA_TitleBarControlTypeId", $treescope_subtree)
_UIA_setVar("oUIElement","Title:=;controltype:=UIA_TitleBarControlTypeId;class:=") ;ControlType:=UIA_TitleBarControlTypeId;classname:=")

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

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

WinActivate ("[class:QWidget]","") or WinActivate ("[class:#32770]","") will work to get the focus..

I'm running windows 10 x64

Thanks for your help

 

Here's wat spy gives me :

Quote

Mouse position is retrieved 1134-141
At least we have an element title: [] class: []

Having the following values for all properties:
Title is: <>    Class   := <>    controltype:= <UIA_TitleBarControlTypeId>    ,<50037>    , (0000C375)    271;119;1286;28
*** Parent Information top down ***
1: Title is: <CLO Enterprise OnlineAuth>    Class   := <QWidget>    controltype:= <UIA_PaneControlTypeId>    ,<50033>    , (0000C371)    0;0;2560;1439
"Title:=CLO Enterprise OnlineAuth;controltype:=UIA_PaneControlTypeId;class:=QWidget""    
0: Title is: <Open File>    Class   := <#32770>    controltype:= <UIA_WindowControlTypeId>    ,<50032>    , (0000C370)    247;116;1318;1136
"Title:=Open File;controltype:=UIA_WindowControlTypeId;class:=#32770""    


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

_UIA_setVar("oP1","Title:=CLO Enterprise OnlineAuth;controltype:=UIA_PaneControlTypeId;class:=QWidget")    ;CLO Enterprise OnlineAuth
_UIA_setVar("oP2","Title:=Open File;controltype:=UIA_WindowControlTypeId;class:=#32770")    ;Open File

;~ $oUIElement=_UIA_getObjectByFindAll(".mainwindow", "title:=;ControlType:=UIA_TitleBarControlTypeId", $treescope_subtree)
_UIA_setVar("oUIElement","Title:=;controltype:=UIA_TitleBarControlTypeId;class:=") ;ControlType:=UIA_TitleBarControlTypeId;classname:=")

;~ 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($oUIElement","highlight")
;~_UIA_action($oUIElement,"click")
;~_UIA_action("oUIElement","highlight")
;~_UIA_action("oUIElement","click")


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

Local $oP1=_UIA_getObjectByFindAll($UIA_oDesktop, "Title:=CLO Enterprise OnlineAuth;controltype:=UIA_PaneControlTypeId;class:=QWidget", $treescope_children)    
_UIA_Action($oP1,"setfocus")
Local $oP0=_UIA_getObjectByFindAll($oP1, "Title:=Open File;controltype:=UIA_WindowControlTypeId;class:=#32770", $treescope_children)    
_UIA_Action($oP0,"setfocus")
;~ First find the object in the parent before you can do something
;~$oUIElement=_UIA_getObjectByFindAll(".mainwindow", "title:=;ControlType:=UIA_TitleBarControlTypeId", $treescope_subtree)
Local $oUIElement=_UIA_getObjectByFindAll($oP0, "title:=;ControlType:=UIA_TitleBarControlTypeId", $treescope_subtree)
;~_UIA_action($oUIElement,"highlight")
_UIA_action($oUIElement,"click")


*** Detailed properties of the highlighted element ***
UIA_iaccessiblevalue:= <Open File>
UIA_iaccessiblechildId:= <0>
UIA_handle:= <0>
UIA_RuntimeId:= <42;6036874;1;-2147483647;6036874;-2;0>
UIA_BoundingRectangle:= <271;119;1286;28>
UIA_ProcessId:= <15260>
UIA_ControlType:= <50037>
UIA_LocalizedControlType:= <barre de titre>
UIA_HasKeyboardFocus:= <False>
UIA_IsKeyboardFocusable:= <True>
UIA_IsEnabled:= <True>
UIA_Culture:= <0>
UIA_IsControlElement:= <True>
UIA_IsContentElement:= <False>
UIA_IsPassword:= <False>
UIA_NativeWindowHandle:= <0>
UIA_IsOffscreen:= <False>
UIA_Orientation:= <0>
UIA_IsRequiredForForm:= <False>
UIA_IsDockPatternAvailable:= <False>
UIA_IsExpandCollapsePatternAvailable:= <False>
UIA_IsGridItemPatternAvailable:= <False>
UIA_IsGridPatternAvailable:= <False>
UIA_IsInvokePatternAvailable:= <False>
UIA_IsMultipleViewPatternAvailable:= <False>
UIA_IsRangeValuePatternAvailable:= <False>
UIA_IsScrollPatternAvailable:= <False>
UIA_IsScrollItemPatternAvailable:= <False>
UIA_IsSelectionItemPatternAvailable:= <False>
UIA_IsSelectionPatternAvailable:= <False>
UIA_IsTablePatternAvailable:= <False>
UIA_IsTableItemPatternAvailable:= <False>
UIA_IsTextPatternAvailable:= <False>
UIA_IsTogglePatternAvailable:= <False>
UIA_IsTransformPatternAvailable:= <False>
UIA_IsValuePatternAvailable:= <True>
UIA_IsWindowPatternAvailable:= <False>
UIA_ValueValue:= <Open File>
UIA_ValueIsReadOnly:= <False>
UIA_RangeValueValue:= <0>
UIA_RangeValueIsReadOnly:= <True>
UIA_RangeValueMinimum:= <0>
UIA_RangeValueMaximum:= <0>
UIA_RangeValueLargeChange:= <0>
UIA_RangeValueSmallChange:= <0>
UIA_ScrollHorizontalScrollPercent:= <0>
UIA_ScrollHorizontalViewSize:= <100>
UIA_ScrollVerticalScrollPercent:= <0>
UIA_ScrollVerticalViewSize:= <100>
UIA_ScrollHorizontallyScrollable:= <False>
UIA_ScrollVerticallyScrollable:= <False>
UIA_SelectionCanSelectMultiple:= <False>
UIA_SelectionIsSelectionRequired:= <False>
UIA_GridRowCount:= <0>
UIA_GridColumnCount:= <0>
UIA_GridItemRow:= <0>
UIA_GridItemColumn:= <0>
UIA_GridItemRowSpan:= <1>
UIA_GridItemColumnSpan:= <1>
UIA_DockDockPosition:= <5>
UIA_ExpandCollapseExpandCollapseState:= <3>
UIA_MultipleViewCurrentView:= <0>
UIA_WindowCanMaximize:= <False>
UIA_WindowCanMinimize:= <False>
UIA_WindowWindowVisualState:= <0>
UIA_WindowWindowInteractionState:= <0>
UIA_WindowIsModal:= <False>
UIA_WindowIsTopmost:= <False>
UIA_SelectionItemIsSelected:= <False>
UIA_TableRowOrColumnMajor:= <2>
UIA_ToggleToggleState:= <2>
UIA_TransformCanMove:= <False>
UIA_TransformCanResize:= <False>
UIA_TransformCanRotate:= <False>
UIA_IsLegacyIAccessiblePatternAvailable:= <True>
UIA_LegacyIAccessibleChildId:= <0>
UIA_LegacyIAccessibleValue:= <Open File>
UIA_LegacyIAccessibleDescription:= <Affiche le nom de la fenêtre et contient des contrôles pour la manipuler>
UIA_LegacyIAccessibleRole:= <1>
UIA_LegacyIAccessibleState:= <1048576>
UIA_IsDataValidForForm:= <False>
UIA_ProviderDescription:= <[pid:16468,hwnd:0x0 Annotation:Microsoft: Annotation Proxy (unmanaged:uiautomationcore.dll); Main(parent link):Microsoft: MSAA Proxy (unmanaged:uiautomationcore.dll)]>
UIA_IsItemContainerPatternAvailable:= <False>
UIA_IsVirtualizedItemPatternAvailable:= <False>
UIA_IsSynchronizedInputPatternAvailable:= <False>

 

 

 

Edited by ratus69
Posted

It helps if you tell if the simplespy puts a highlighting rectangle around your object(s).

Check also with inspect.exe from MS WIN 10 SDK if your elements can be found.

you could try to skip $op1.setfocus as frequently not all elements in hierarchy have to be set focus to and as its a popup very likely its not needed it all.

I assume after your window has focus you want to interact with the elements in it. As I see QtWidget in your hierarchy it really depends on which version and how nicely your developers have build the application  with accessibilityattributes.

Posted (edited)

thanks for your help junkew

I don't want to waste your time and pollute this thread so perhaps I will need to open an other thread

I have installed window inspector who seems to be as good as inspector and don't need 2Gb of installation

here it is what I get for the frame containing the menu File Edit ... of the program I want to dialog with

2017-06-13_05361.png

What I would like to do is to select file > import > alembic or to send shift - A which is the shortcut for this command, to the program

I have tried Send, ControlSend with IDs, class etc but nothing seems to work so I thought UIA could make it but I don't get how to send text or command or clicks to this type of Qwidget

anyway thanks again

Edited by ratus69
Posted

Window Detective will determine far less then inspect and simplespy will do (and ranorex spy will do better I think on QT stuff).
Try yourself on the tabsheets of scite. Detective will see it as one large area whereas inspect will recognize them (and simplespy the same as its both based on IUIAutomation). Why try with Inspect.exe? The simplespy cannot show layers that have a "weird" hierarchy which can be seen with the treewalker(s) that inspect.exe is using.

Anyway from a distance its hard if you do not attach a screenshot of your window that comes up and if you see the window/element in the treeview of your spy.

This example is normally enough to highlight your popup and setfocus

_UIA_setVar("oP2","Title:=Open File;controltype:=UIA_WindowControlTypeId;class:=#32770")    ;Open File 
_UIA_Action("oP2","highlight") 
_UIA_Action("oP2","setfocus")

1.  Is simplespy drawing a rectangle around your window or around your element of interest?

2, What is detective telling you? highlight window or is element of interest highlighted?

If the element of interest is not highlighted then solution is most likely with sendkeys (or try with Ranorex tooling)

If the element of interest is highlighted then you should determine all (grand)parents and start at the root with

_UIA_setVar("oP1",...)    ;Open File 
_UIA_Action("oP1","highlight")
_UIA_Action("oP1","setfocus")

and when that works at only oP2 in a similar way it that then does not work on P2 you know you can skip that one and try with P3 and so till you are at leaf level.

Posted

hello junkew,

1. simplespy draw a red rectangle around the element of interest without problem

2. detective seems to have been improved since it tells a lot than a simple block, here it is what I get for my application CLO and for Scite :

window detective CLO

window detective Scite

detective draw a red rectangle too around the elements like this and focus in the hierarchy list the item selected  :

window detective target element

Now if ranorex spy or inspect gives more element I will install them, just tell me if window detective gives enough info or not

There's one thing I don't understand : if I focus in my window using  WinActivate ("CLO Enterprise OnlineAuth","") and I try to move the mouse using mousemove nothing happen, the mouse is not moving at all, it's very strange...

I will try your examples

thanks a bunch for your help junkew !

 

Posted

ok I have tried your example and the script is hanging but nothing happen

I have tried it with an other application with a #32770 window class and it takes up to 25 seconds before highlighting the window

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
×
×
  • Create New...