automationelement

Get name of window which is being closed using automation events c#

安稳与你 提交于 2020-04-15 15:32:14
问题 I'm working on a project where I need to get the name of windows which is being closed . I'm using C# Automation events for this. I've pasted below the code that I'm using: Automation.AddAutomationEventHandler(WindowPattern.WindowClosedEvent, AutomationElement.RootElement, TreeScope.Subtree, (sender, eve) => { AutomationElement winElemnt = sender as AutomationElement; if (winElemnt != null) { Console.WriteLine("Window closed : " + winElemnt.Current.Name); } }); The above code get triggered

Get name of window which is being closed using automation events c#

女生的网名这么多〃 提交于 2020-04-15 15:32:08
问题 I'm working on a project where I need to get the name of windows which is being closed . I'm using C# Automation events for this. I've pasted below the code that I'm using: Automation.AddAutomationEventHandler(WindowPattern.WindowClosedEvent, AutomationElement.RootElement, TreeScope.Subtree, (sender, eve) => { AutomationElement winElemnt = sender as AutomationElement; if (winElemnt != null) { Console.WriteLine("Window closed : " + winElemnt.Current.Name); } }); The above code get triggered

Using Windows.Automation, can I locate an AutomationElement by regex?

血红的双手。 提交于 2019-12-23 02:42:22
问题 I have an object tree that has row objects within a table parent. I'm attempting to put all these rows into an AutomationElementCollection AutomationElementCollection asdf = ParentTableObj.FindAll ( TreeScope.Children, new PropertyCondition ( AutomationElement.NameProperty, "I want to use regex here" ) ); All of the rows' AutomationElement.NameProperty contains the string "row". However, they are variations of that string - e.g. "Row1", "Row2", "TopRow", ... It seems like I may be missing

AutomationElement / Context Menus

Deadly 提交于 2019-12-11 11:03:00
问题 Description I am trying to be able to interact with context menus using UI Automation. Basically, I am trying to: set focus on an AutomationElement SendKeys.SendWait to send a SHIFT+F10 see what pops up What I Am Seeing What I am seeing is that the AutomationElement.FindAll(TreeScope.Descendants, Condition.TrueCondition) does not seem to reflect when the context menu is popped, even though UISpy sees it. Any help would be greatly appreciated. Example Here is an example application that I have