在我的窗口对话框的编码 UI 项目中,我似乎无法克服这个异常。我试过使用总是搜索和其他一些选项。我试图使用打开窗口对话框按钮的选项,但这似乎不起作用,因为我没有看到打开按钮只有“确定”和一些与我试图做的事情无关的按钮。
我看到我的一个窗口正在返回 5 个窗口,我正在尝试使用代码 Order Of overcation 但这似乎不起作用。
目前这是我最新的代码,它仍然无法正常工作,仍然给我同样的异常错误
WinWindow myDialogBox = new WinWindow();
myDialogBox.FilterProperties.Add(WinWindow.PropertyNames.OrderOfInvocation, "5");
myDialogBox.SearchConfigurations.Add(SearchConfiguration.AlwaysSearch);
myDialogBox.SearchProperties[WinWindow.PropertyNames.ClassName] = "DirectUIHWND";
myDialogBox.SearchProperties[WinWindow.PropertyNames.ControlId] = "0";
myDialogBox.DrawHighlight();
WinWindow MyOpbenButton = new WinWindow(myDialogBox);
// myDialogBox.SearchProperties.Add(WinWindow.PropertyNames.OrderOfInvocation, "0");
MyOpbenButton.SearchConfigurations.Add(SearchConfiguration.AlwaysSearch);
MyOpbenButton.SearchProperties[WinWindow.PropertyNames.Name] = "&Open";
MyOpbenButton.SearchProperties[WinWindow.PropertyNames.ClassName] = "Button";
//MyOpbenButton.SearchProperties[WinWindow.PropertyNames.ControlId] = "0";
MyOpbenButton.DrawHighlight();
//Testing this window produces 5 window with the same name and
control ID.
WinWindow matchingWindows = new WinWindow(myDialogBox);
matchingWindows.SearchProperties.Add("Name", "&Open");
// matchingWindows.SearchProperties.Add("ControlId", "0");
matchingWindows.SearchProperties.Add("ClassName", "Button");
UITestControlCollection windowsFound = matchingWindows.FindMatchingControls();
WinPane MyOpbenPane = new WinPane(MyOpbenButton);
MyOpbenPane.SearchConfigurations.Add(SearchConfiguration.AlwaysSearch);
//MyOpbenPane.SearchProperties[WinPane.PropertyNames.Name] = "Open";
MyOpbenPane.SearchProperties[WinPane.PropertyNames.ClassName] = "Button";
// var myDialog = sharedControls.UIWindowsInternetExploWindow.UIWindowsInternetExplo_Open_Save_Dialog_LinksPage.UIItemWindow;
MyOpbenPane.DrawHighlight();
return MyOpbenPane;
这产生的错误消息如下:
另一个控件正在阻止该控件。请使被阻止的控件可见,然后重试该操作。其他详细信息: \r\nTechnologyName: 'MSAA'\r\nName: '&Open'\r\nClassName: 'Button'\r\nControlType: 'Window'\r\n