【发布时间】:2017-03-26 22:47:24
【问题描述】:
我正在使用 System.Windows.Automatition.UiTesting 程序集来启动几个进程并分析它们的主窗口。 如何创建显示窗口的屏幕截图?
Process process = new Process();
process.StartInfo.FileName = ExecutablePath;
if (!process.Start()){
throw new Exception.Create("Could not start Process.");
}
Thread.Sleep(TimeSpan.FromSeconds(10));
process.Refresh();
AutomationElement mainWindow = AutomationElement.FromHandle(process.MainWindowHandle);
var imageFromWindow = ...?
该窗口可能(部分)被其他窗口隐藏。
【问题讨论】:
标签: c# ui-automation