Jump to content

poisonkiller

Active Members
  • Posts

    519
  • Joined

  • Last visited

Profile Information

  • Member Title
    You reached -1 posts!

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

poisonkiller's Achievements

Universalist

Universalist (7/7)

0

Reputation

  1. @junkew, thanks, I'll slowly start going through all the links you have provided (especially the chromium accessibility source seems quite interesting). But it it seeming more and more likely that this is just a bug in Chromium or UIA... I think I'll read the Chromium accessibility source code and if it doesn't reveal anything, then I'll report a bug. @malcev, thank you for the suggestion, but in this case it doesn't seem to be relevant. After using MSAA ObjectFromPoint doesn't change the UIA tree, neither after your example nor inspecting with inspect.exe in MSAA mode (which should be calling both ObjectFromPoint and getting roles/names). As a side-note, the Sleep 300 might sometimes not be enough, since my tests have shown that some windows take a very short time to enable MSAA/UIA trees, but others might take >300ms (especially windows with thousands of elements, like Chrome with a very complex website open). In UIA you can dynamically wait for the tree be constructed by sending the SendMessage signal, then find the element in the window for ClassName:=Chrome_RendererWidgetHostHWND, get the CurrentName (this part is important, otherwise ValuePattern ValueValueProperty is not accessible) and then wait for ValueValueProperty to have a value (which is usually an URL).
  2. Although this discussion feels more like belonging to a PM, I'll answer publicly (since you did): 1) I first contacted the author of this thread and he recommended I post my question here on the forums 2) "are used to" is very incorrect, since this is the first time. 3) The why... UIAutomation is a rather niche topic, and interacting with it through COM even moreso. Most of the Google results about UIAutomation contain at least some links to this forum, and the userbase for UIAutomation is much larger here, and has years more experience with it. My question is also quite niche, and hours of Googling hasn't resulted in anything. If there is any place to at least hope to get an answer, I think it would be here. To not get totally offtopic, here is my current workaround to get access to Skype and other Chromium-based apps: after activating the window with WinActivate(), get an element from inside the content with either UIA GetFocusedElement or ElementFromPoint. Then use a condition for ControlType:=Document to create a TreeWalker and use that TreeWalker's NormalizeElement method to get the Document element, which contains all the Chromium content. The other elements of the window (for example minmax buttons) you can get with the regular ElementFromHandle. Although this is a hacky workaround, at least it works... But a ElementFromHandle approach would be preferrable, and the question still remains that why is there a disconnect between Skype window element and the Chromium Document element.
  3. Hello, I am hopping here from AHK forums to hopefully get some advice about automating Skype, since Autoit has a much longer history with UIA . The thing is, Skype (and other Electron/Chromium apps) is very fussy with UIAutomation. ElementFromPoint and GetFocusedElement seems to work fine, but using FindAll with TrueCondition on the Skype window element doesn't display the whole UIA tree, and neither does recursively iterating over the Skype window elements with a TreeWalker with TrueCondition nor RawViewWalker: the content (Chromium) part is always missing. I've tried sending the WM_GETOBJECT message to Chrome_RenderWidgetHostHWND1 control, but it seems Chromium is activated, just not accessible. Setting up an event handler to send WM_GETOBJECT after a EVENT_SYSTEM_ALERT doesn't work. Also if it accessibility was turned off, then ElementFromPoint wouldn't work, so I think the problem is somewhere else. Activating the window or bringing to focus beforehand doesn't matter, the content still isn't found. When I run the following snippet with Skype open: Local $oP1=_UIA_getObjectByFindAll($UIA_oDesktop, "Title:=Skype;controltype:=UIA_PaneControlTypeId", $treescope_children) _UIA_Action($oP1,"setfocus") _UIA_DumpThemAll($oP1, $treescope_subtree) I get this: <log space="preserve"> <logline level="5" timestamp="20220712-134100996"> <information> Information _UIA_VersionInfo version: T0.7-0; Release date: 20190501; OS Version: WIN_10</information> </logline> <logline level="5" timestamp="20220712-134100996"> _UIA_normalizeExpression Title:=Skype;controltype:=UIA_PaneControlTypeId;elements 1-2 in properties array</logline> <logline level="5" timestamp="20220712-134100997"> _UIA_normalizeExpression property 1 Title:=Skype</logline> <logline level="5" timestamp="20220712-134100997"> name:[Title] value:[Skype] having index 3</logline> <logline level="5" timestamp="20220712-134100999"> _UIA_normalizeExpression property 2 controltype:=UIA_PaneControlTypeId</logline> <logline level="5" timestamp="20220712-134101999"> name:[controltype] value:[50033] having index 15</logline> <logline level="5" timestamp="20220712-134101000"> *** Try to get a list of elements *** treescopetype:=2</logline> <logline level="0" timestamp="20220712-134101362"> _UIA_getObjectByFindAll walk thru the tree with n elements where n equals 11</logline> <logline level="5" timestamp="20220712-134101398"> Found match with element: 4 the Name is: <Title is: <Skype> Class := <Chrome_WidgetWin_1> controltype:= <UIA_PaneControlTypeId> ,<50033> , (0000C371) rect := < 10;0;620;680> hwnd := < 2427216> acceleratorkey := < > automationid := <> </logline> <logline level="5" timestamp="20220712-134101398"> <propertymatching/> </logline> <logline level="5" timestamp="20220712-134101405"> Storing parent for found object in RTI as RTI.PARENT Desktop 1</logline> <logline level="0" timestamp="20220712-134101539"> </logline> <logline level="0" timestamp="20220712-134101541"> Quickly referenced object : <action>Action 1 setfocus on _UIA_IsElement:=1 Parameters 1:=0 2:=0 3:=0 4:=0</action></logline> <logline level="0" timestamp="20220712-134102161"> <treedump> <treeheader>***** Dumping tree *****</treeheader> <elementinfo>Title is: <Skype> Class := <Chrome_WidgetWin_1> controltype:= <UIA_PaneControlTypeId> ,<50033> , (0000C371) , acceleratorkey:= <> , automationid:= <> </elementinfo> <elementinfo>Title is: <> Class := <Intermediate D3D Window> controltype:= <UIA_PaneControlTypeId> ,<50033> , (0000C371) , acceleratorkey:= <> , automationid:= <> </elementinfo> <elementinfo>Title is: <> Class := <> controltype:= <UIA_TitleBarControlTypeId> ,<50037> , (0000C375) , acceleratorkey:= <> , automationid:= <> </elementinfo> <elementinfo>Title is: <System> Class := <> controltype:= <UIA_MenuBarControlTypeId> ,<50010> , (0000C35A) , acceleratorkey:= <> , automationid:= <MenuBar> </elementinfo> <elementinfo>Title is: <System> Class := <> controltype:= <UIA_MenuItemControlTypeId> ,<50011> , (0000C35B) , acceleratorkey:= <> , automationid:= <> </elementinfo> <elementinfo>Title is: <Minimize> Class := <> controltype:= <UIA_ButtonControlTypeId> ,<50000> , (0000C350) , acceleratorkey:= <> , automationid:= <> </elementinfo> <elementinfo>Title is: <Maximize> Class := <> controltype:= <UIA_ButtonControlTypeId> ,<50000> , (0000C350) , acceleratorkey:= <> , automationid:= <> </elementinfo> <elementinfo>Title is: <Close> Class := <> controltype:= <UIA_ButtonControlTypeId> ,<50000> , (0000C350) , acceleratorkey:= <> , automationid:= <> </elementinfo> <elementinfo>Title is: <> Class := <> controltype:= <UIA_PaneControlTypeId> ,<50033> , (0000C371) , acceleratorkey:= <> , automationid:= <> </elementinfo> <elementinfo>Title is: <> Class := <> controltype:= <UIA_PaneControlTypeId> ,<50033> , (0000C371) , acceleratorkey:= <> , automationid:= <> </elementinfo> <elementinfo>Title is: <> Class := <> controltype:= <UIA_PaneControlTypeId> ,<50033> , (0000C371) , acceleratorkey:= <> , automationid:= <> </elementinfo> <elementinfo>Title is: <> Class := <> controltype:= <UIA_PaneControlTypeId> ,<50033> , (0000C371) , acceleratorkey:= <> , automationid:= <> </elementinfo> <elementinfo>Title is: <> Class := <> controltype:= <UIA_PaneControlTypeId> ,<50033> , (0000C371) , acceleratorkey:= <> , automationid:= <> </elementinfo> </treedump> </logline> </log> When I inspect the Skype window with Accessibility Insights, the tree also contains Window element with CurrentName="Skype" and Document element with CurrentName="Skype", both of which are missing from _DumpThemAll. I've tested this on other Windows builds and the result seems to be the same. Sometimes when I kill all skype.exe processes and start Skype freshly, it works until Skype has been hidden behind another window, then it stops working and nothing gets it working again. In my main build, the FindAll/TreeWalker methods haven't worked even after killing the Skype processes. Perhaps user @LarsJ has ideas what might be going on? A bug in UIA?
  4. Do you mean this? MsgBox(0, "", @IPAddress1)
  5. If I would be 13 years old, I'd switch into safe mode, delete that .exe and do something nasty to my parents, 'cause they tried to take away my internet.
  6. No, you can't change a hardcoded password, but you could encrypt it and store in registry/.ini
  7. Very nice program! Where is everybody, not one person has replied me (in IRC, I mean)...
  8. @martin: Ah, whatever, the only important thing is, that it works. If Vaeb wants, he can use If...EndIf. @Vaeb: I don't really know, how to return text of a checkbox (if it's even possible), but one workaround is to add Dim $gui_check_text[$linkname[0] + 1]oÝ÷ ÚéÝz¶®¶­sdFÒb33c¶wVö6V6µõ²b33c¶Ææ¶æÖU³Ò²ÐoÝ÷ ٩ݶ§jëh×6$gui_check_text[$i] = $pr2 & $srv3
  9. Actually, I tested my code, and everything worked as I expected. Btw, I did use Switch $i and nothing went wrong... Maybe using If...EndIf saves some lines, but I used Switch...EndSwitch, so if in the future he wants to add something, it's easier.
  10. Try if this works, I can't test it right now... Func Check() GUISetState(@SW_HIDE, $Gui1) $Check = GUICreate("Default", 701, 641) Opt("GUICloseOnESC", 1) $linkname = _FileListToArray("\\srv\root\Group\Public\Printers\zh\" & $n & "Obergeschoss\" & $ort, '*.lnk', 1) Dim $gui_check_[$linkname[0] + 1] Dim $read[$linkname[0] + 1] For $i = 1 To $linkname[0] $pr = StringInStr($linkname[$i], " ", 1) $prLen = StringLen($linkname[$i]) $pr3 = $prLen - $pr $pr2 = StringTrimRight($linkname[$i], $pr3) $srv = StringInStr($linkname[$i], " ", 1, 1) $srv2 = StringTrimLeft($linkname[$i], $srv + 3) $srv3 = StringTrimRight($srv2, 4) $gui_check_[$i] = GUICtrlCreateCheckbox($pr2 & $srv3, 10, -10 + $i * 20, 680, 20) $read[$i] = GUICtrlRead($gui_check_[$i]) Next $buttoninst = GUICtrlCreateButton("Install", 135, 350) GUISetState(@SW_SHOW, $Check) While 1 $Msg = GUIGetMsg() Switch $Msg Case $GUI_EVENT_CLOSE Exit Case $buttoninst For $i = 1 to $linkname[0] Switch $i Case GUICtrlRead($gui_check_[$i]) = $GUI_CHECKED $pr = StringInStr($read[$i], " ", 1);abstand des strings $prLen = StringLen($read[$i]);länge des strings $pr3 = $prLen - $pr;abstand andere seite $pr2 = StringTrimRight($read[$i], $pr3);server $srv = StringInStr($read[$i], " ", 1);abstand des strings $srv2 = StringTrimLeft($read[$i], $srv) RunWait("rundll32 printui.dll,PrintUIEntry /in /n \\" & $srv2 & "\" & $pr2) RunWait("rundll32 printui.dll,PrintUIEntry /in /n \\" & $srv2 & "\" & $pr2 & "/y") MsgBox(0, $i, $srv3) EndSwitch Next EndSwitch WEnd EndFunc ;==>Check
  11. Try replacing $gui_check_1 with $gui_check_[1] and other $gui_check_...-s too.
  12. Try this: #include <GUIConstants.au3> GUICreate("Deploiement d'appli") Opt("GUICoordMode",2) GUICtrlCreateLabel ("Veuillez rentrer le reseau à scanner", 10, 10) GUICtrlCreateLabel ("192.168.", -100, 10,50) $Network = GUICtrlCreateInput ("200", 0, -21, 50) GUICtrlCreateLabel ("de ", 5, -21,50) $Network1 = GUICtrlCreateInput ("3", -20, -21, 50) GUICtrlCreateLabel ("à ", 5, -21,50) $Network2 = GUICtrlCreateInput ("200", -20, -21, 50) $Flag = GUICtrlCreateCheckbox ("Verifier Flag", -200, 10, 100) $run = GUICtrlCreateButton ("Deployer", -100, 300, 100) GUISetState () While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $Flag If GUICtrlRead($Flag) <> $GUI_CHECKED Then GUICtrlSetState($Network, $GUI_SHOW) Else GUICtrlSetState($Network, $GUI_HIDE) EndIf Case $msg = $Run $NetworkRead = GUICtrlRead($Network) $NetworkRead1 = GUICtrlRead($Network1) $NetworkRead2 = GUICtrlRead($Network2) msgbox(0,"texte tapé","Vous allez deployer de 192.168."&GUICtrlRead($Network)) ;~ deploy($NetworkRead,$NetworkRead1,$NetworkRead2) EndSelect Wend Func deploy($RESEAU,$IPSTART,$IPEND) For $i = $IPSTART to $IPEND Step 1 $IP=$RESEAU&"."&$i Next MsgBox(0,"nom du reseau", "noim du reseau est "&$IP) EndFunc
  13. I can't understand what you are trying to accomplish... Are you trying to make a script, which checks, if a checkbox is checked, and when it is, hide an inputbox, and vice-versa?
  14. Are you sure your RunWait functions work? Try them out, if they work, I have no idea whats wrong.
  15. HotKeySet("{END}", "Stop") $run = 1 While $run ;Do stuff WEnd Func Stop() $run = 0 EndFuncoÝ÷ Ø@ÈL+y«^Å©©çë¢h^âæ®¶­sc²&W72W62FòFW&ÖæFR67&BÂW6Rô'&V²FògV÷C·W6RgV÷C° ¤vÆö&Âb33cµW6V@¤÷D¶W6WBgV÷C·µU4WÒgV÷C²ÂgV÷CµFövvÆUW6RgV÷C²¤÷D¶W6WBgV÷C·´U47ÒgV÷C²ÂgV÷CµFW&ÖæFRgV÷C²¤÷D¶W6WBgV÷C²²b333¶BgV÷C²ÂgV÷Cµ6÷tÖW76vRgV÷C²µ6gBÔÇBÖ@ £³³³²&öGöb&öw&Òv÷VÆBvòW&R³³³°¥vÆR¢6ÆVW¥tVæ@£³³³³³³³° ¤gVæ2FövvÆUW6R¢b33cµW6VBÒäõBb33cµW6V@¢vÆRb33cµW6V@¢6ÆVW¢FööÅFb33µ67&B2gV÷CµW6VBgV÷C²b33²ÃâtVæ@¢FööÅFgV÷C²gV÷C²¤VæDgVæ0 ¤gVæ2FW&ÖæFR¢WB¤VæDgVæ0 ¤gVæ26÷tÖW76vR¢×6t&÷CbÂgV÷C²gV÷C²ÂgV÷CµF22ÖW76vRâgV÷C²¤VæDgVæ
×
×
  • Create New...