public static PopUpMenu getContextMenu(this API_GuiAutomation guiAutomation) { try { var emptyWindow = guiAutomation.desktopWindow(""); return(emptyWindow.Popup); } catch { } return(null); }
public static Window desktopWindow(this API_GuiAutomation guiAutomation, string name, int numberOfTries) { for (int i = 0; i < numberOfTries; i++) { var window = guiAutomation.desktopWindow(name); if (window.notNull()) { "after {0} tries, found window with title: {1}".info(i, name); return(window); } guiAutomation.sleep(1000, false); } "after {0} tries, cound not find window with title: {1}".info(numberOfTries, name); return(null); }