Handle Win32 Dialog box in White

It seems that there's no exsited way to handle Win32 Dialog Box in White. At least I have not found till now.

// Click 'Yes' Button in Pop up Window

 

View Code
1           System.Windows.Automation.AutomationElement element = Desktop.Instance
2                 .GetElement(SearchCriteria.ByNativeProperty(System.Windows.Automation.AutomationElement.ClassNameProperty, "#32770"));
3             element = element.FindFirst(System.Windows.Automation.TreeScope.Descendants,
4                 new PropertyCondition(AutomationElement.NameProperty, "Yes", PropertyConditionFlags.IgnoreCase));
5             Button yesButton = new Button(element, new NullActionListener());
6             yesButton.Click();

   

 

 

posted @ 2011-04-11 09:39  Longmarch2008  阅读(278)  评论(0编辑  收藏  举报