Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Then, as Raymond suggested, why don't you try with Automation? Add a console project with references to <code>UIAutomationClient</code> and <code>UIAutomationTypes</code></p> <pre><code>using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Windows.Automation; using System.Diagnostics; using System.Threading; namespace ConsoleApplication { class Program { static void Main(string[] args) { var pInfo = new ProcessStartInfo("notepad"); var p = Process.Start(pInfo); p.WaitForInputIdle(); AutomationElement installerEditorForm = AutomationElement.FromHandle(p.MainWindowHandle); // menus AutomationElementCollection menuBars = installerEditorForm.FindAll(TreeScope.Children, new PropertyCondition( AutomationElement.ControlTypeProperty, ControlType.MenuBar)); var mainMenuItem = menuBars[0]; AutomationElementCollection menus = mainMenuItem.FindAll(TreeScope.Children, new PropertyCondition( AutomationElement.ControlTypeProperty, ControlType.MenuItem)); var fileMenuItem = menus[0]; ExpandCollapsePattern fileMenuItemOpenPattern = (ExpandCollapsePattern)fileMenuItem.GetCurrentPattern( ExpandCollapsePattern.Pattern); fileMenuItemOpenPattern.Expand(); AutomationElement fileMenuItemNew = fileMenuItem.FindFirst(TreeScope.Children, new AndCondition( new PropertyCondition(AutomationElement.ControlTypeProperty, ControlType.MenuItem), new PropertyCondition(AutomationElement.NameProperty, "New"))); Console.Read(); } } } </code></pre> <p><a href="http://code.dblock.org/automating-win32-ui-testing-systemwindowsautomation-and-project-white" rel="nofollow">reference</a></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload