I am learning Windows UI Automation, I intent to Add Automation Event Handler on Start menu, But when i click the Start menu, nothing happened on Windows 10 .
I try the same application on Windows 7,It works Could anyone help me. Thanks.
private static void EventHandler()
{
AutomationElement start = null;
PropertyCondition conds = new PropertyCondition(AutomationElement.NameProperty, "Start");
start = AutomationElement.RootElement.FindFirst(TreeScope.Descendants, conds);
if (start != null)
{
Automation.AddAutomationEventHandler(InvokePattern.InvokedEvent, start,
TreeScope.Element, new AutomationEventHandler(OnStartInvoke));
}
}