Modal dialogs causing user interface automation to freeze

I am trying to implement user interface automation in a WPF application, but whenever a modal dialog appears, the user interface automation will hang until the dialog is closed manually.

So far, I have been trying to use the second thread to close the dialog box, installing the application to use the MTA streams, using RaiseEvent to raise Button.ClickEvent on the button to close the dialog box, and using sendinput to send the keystroke in the dialog box. None of these methods work, and I did not find any other workarounds to try.

Does anyone know of possible solutions?

+4
source share
2 answers

UI retention is the definition and purpose of a modal dialog. If you do not want to hold the user interface, you need a mode dialog box. The user interface is not hanging. Modal dialogue does exactly what it should do.

0
source

Source: https://habr.com/ru/post/1403285/


All Articles