I'm trying to implement UI automation in a WPF application but whenever a modal dialog appears the UI automation will hang until the dialog is manually closed.

So far I've tried using a second thread to close the dialog box, setting the application to use MTA threads, using RaiseEvent to raise the Button.ClickEvent on the button to close the dialog, and using sendinput to send a keypress to the dialog. None of these methods are working and I haven't found any other workarounds to try.

Does anyone know of any possible solutions?

有帮助吗?

其他提示

Hold the UI is definition and purpose of a modal dialog. If you don't want to hold the UI then you want a modeLESS dialog. The UI is not hanging. The modal dialog is doing exactly what it is supposed to do.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top