microsoft-ui-automation

UI Automation not working for DataGridView

☆樱花仙子☆ 提交于 2019-12-05 19:57:55
After trying out several solutions, I am in desperate need for help. I tried several approaches, before finally copying and still being stuck with the solution from Getting full contents of a Datagrid using UIAutomation . Let's talk code, please consider the comments: // Get Process ID for desired window handle uint processID = 0; GetWindowThreadProcessId(hwnd, out processID); var desktop = AutomationElement.RootElement; // Find AutomationElement for the App's window var bw = AutomationElement.RootElement.FindFirst(TreeScope.Children, new PropertyCondition(AutomationElement.ProcessIdProperty,

Get TitleBar Caption of any application using Microsoft UI Automation?

六月ゝ 毕业季﹏ 提交于 2019-12-02 01:54:29
In C# or else VB.Net , how I could use Microsoft UI Automation to retrieve the text of any control that contains text?. I've been researching in the MSDN Docs, but I don't get it. Obtain Text Attributes Using UI Automation Then, for example, with the code below I'm trying to retrieve the text of the Window titlebar by giving the hwnd of that window, but I don't know exactlly how to follow the titlebar to find the child control (label?) that really contains the text. Imports System.Windows.Automation Imports System.Windows.Automation.Text . Dim hwnd As IntPtr = Process.GetProcessesByName(

Get TitleBar Caption of any application using Microsoft UI Automation?

▼魔方 西西 提交于 2019-12-02 01:06:28
问题 In C# or else VB.Net , how I could use Microsoft UI Automation to retrieve the text of any control that contains text?. I've been researching in the MSDN Docs, but I don't get it. Obtain Text Attributes Using UI Automation Then, for example, with the code below I'm trying to retrieve the text of the Window titlebar by giving the hwnd of that window, but I don't know exactlly how to follow the titlebar to find the child control (label?) that really contains the text. Imports System.Windows

If I programmatically activate a window in another application, can I detect when it loses focus?

独自空忆成欢 提交于 2019-12-01 11:07:24
Bear with me, I'm a web developer attempting a WinForms application. When responding please do not comment on whether the purpose of my application is a "best practice" or not, etc... This is the application I need to write, for better or worse, and I cannot waste time explaining the "why". I ask that you please just reply with advice on (1) Is what I'm trying to do possible (2) What is the "best" way to accomplish what I'm trying to do. So, here's what I'm trying to do: I need to write a WinForms application that will read data from a vendor application, display certain records to the end

powershell: how to click a “submit type” input

℡╲_俬逩灬. 提交于 2019-12-01 09:22:07
used powershell to do web ui automation. came up an exception: invoke method failed, because [System.__ComObject] does not contain “click” method. can submit type input be clicked? i used getElementsByTagName getElementsByClassName getElementsByName , does not work. anyone can help me on this? powershell code is below: # open the specified web site and commit the key $ie = new-object -com "InternetExplorer.Application" $ie.navigate("http://gitlab.alibaba-inc.com/keys/new") $ie.visible = $true while($ie.busy) {sleep 1} $doc = $ie.document # commit the button $commit = $doc.getElementsByTagName(

powershell: how to click a “submit type” input

爷,独闯天下 提交于 2019-12-01 05:46:31
问题 used powershell to do web ui automation. came up an exception: invoke method failed, because [System.__ComObject] does not contain “click” method. can submit type input be clicked? i used getElementsByTagName getElementsByClassName getElementsByName , does not work. anyone can help me on this? powershell code is below: # open the specified web site and commit the key $ie = new-object -com "InternetExplorer.Application" $ie.navigate("http://gitlab.alibaba-inc.com/keys/new") $ie.visible = $true

MSAA UI Automation get_accChildCount Incorrectly Returning 0 for Infragistics UltraTree in Winforms

依然范特西╮ 提交于 2019-11-29 18:17:19
While working on automating an Infragistics UltraTree control in a C# Winforms application I found that the UltraTree implemented the AccessibleObject model (MSAA). I was able to successfully grab the IAccessible interface by putting the hwnd grabbed from spy++ into IAccessible* accessibleObject; AccessibleObjectFromWindow(hwnd, OBJID_CLIENT, IID_IAccessible, (void**)&accessibleObj); The problem is that when I now call long childCount; accessibleObj->get_accChildCount(&childCount); The result that I get back is zero. From looking at the UltraTree source code I noticed that its implementation

Reading out Edge Browser Title & Url with System.Windows.Automation

我是研究僧i 提交于 2019-11-29 15:33:34
I'm trying to read out the TITLE & URL from the Microsoft EDGE Browser. Doing this with System.Windows.Automation most preferably since the code base already uses this for other problems. Is it possible with System.Windows.Automation? How to access the URL? I'm currently this far: AutomationId "TitleBar" ClassName "ApplicationFrameWindow" Name = [string] => Reading out this element gives me the TITLE => Walking it's children, I find the item "addressEditBox": AutomationId "addressEditBox" ClassName "RichEditBox" Name "Search or enter web address" => I always get back the string "Search or

UIAutomation won't retrieve children of an element

ぐ巨炮叔叔 提交于 2019-11-29 07:28:31
I can see that an element with specific Automation ID has children in the Inspect tool: But when I try to retrieve them like this: AutomationElement aPane = mainWindow.FindFirst(TreeScope.Subtree, new PropertyCondition(AutomationElement.AutomationIdProperty, "8264")); AutomationElementCollection theChildren = aPane.FindAll(TreeScope.Subtree, Condition.TrueCondition); The aPane element is retrieved correctly, but theChildren element is empty. Any ideas what went wrong? On rare occasions I've found that the Find* calls don't find all automation objects. The only consistent case I've seen with

How to use MS UI Automation in Delphi 2009

感情迁移 提交于 2019-11-28 13:01:49
I have a C# application, which uses Microsoft UI Automation functionality, e. g. a call like AutomationElement.RootElement.FindFirst(...) . Now I need to do the same thing (use MS UI Automation) in Delphi 2009. How can I a) declare that my Delphi code uses MS UI Automation library and b) make calls like AutomationElement.RootElement.FindFirst(...) ? There are several tutorials ( tutorial 1 , tutorial 2 ) explaining how to package one's own .NET code so that it can be used with Delphi, but in my case I need to use "pre-packaged" (already installed) assembly in Delphi. Update 1 Now I can get