Jul 2, 2010 at 5:43 AM
Edited Jul 2, 2010 at 6:21 AM
I don't know much about 'Briks Clock' in White framework.
But I think you can have a try with the following solution: use basic UI Automation elements (shipped by .Net Framework 3.5) to access the menuItem you mentioned.
Assume that you want to check the menuItems under 'Help' in Windows Calculator, use the following code:
private void ShowMenuItemsUnderHelp()
//Get the Calculator
AutomationElement calc = AutomationElement.RootElement.FindFirst(TreeScope.Children,
new PropertyCondition(AutomationElement.NameProperty, "Calculator"));
//Get the 'Help' menu item in menubar
AutomationElement help = calc.FindFirst(TreeScope.Descendants,
new PropertyCondition(AutomationElement.NameProperty, "Help"));
//Expand the 'Help' menu item
//Find all menu items under 'Help'
AutomationElementCollection menuItems = help.FindAll(TreeScope.Descendants,
new PropertyCondition(AutomationElement.ControlTypeProperty, ControlType.MenuItem));
Before running this code, make sure that you opened a Windows Calculator and no window covers on it.
Add a break point at the last line (the '}' line), and run it.
When the debugger stops you can watch the AutomationElementCollection 'menuItems', it will have two elements, one is menu item 'Help Topics' and the other is 'About Calculator'.
Further more if you want to 'Click' on the 'Help Topics', use the following code:
Is your problem solved?