Advertisement
Guest User

Untitled

a guest
Sep 1st, 2014
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. Process[] procsChrome = Process.GetProcessesByName("chrome");
  2. foreach(Process chrome in procsChrome)
  3. {
  4. if(chrome.MainWindowHandle == IntPtr.Zero)
  5. {
  6. continue;
  7. }
  8. AutomationElement mainWindow = AutomationElement.FromHandle(chrome.MainWindowHandle);
  9. elmUrlBar = mainWindow.FindFirst(TreeScope.Descendants, new PropertyCondition(AutomationElement.ControlTypeProperty, ControlType.Edit));
  10.  
  11. //elmUrlBar on some computers inited, on some NULL. But versions of Chrome are identical.
  12. ...
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement