Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

6
  • Thank you for your answer, but I'm afraid there is a big misunderstanding here: "you are asking for ways to automate answering/clicking specific dialogs". No, that's not I want to do. I want to keep a modal dialog open (e.g. a settings dialog) and switch back and forth between that dialog and its main window, interacting with both at the same time. Not sure how I failed to communicate this. If you have some hints on what gave you this idea, I might be able to improve my question. ... Maybe I can add a mock screencast of Windows Explorer where I show the expected behavior after the change.
    – Socowi
    Commented Jun 16, 2020 at 8:55
  • 1
    I was trying to read your question in a way that can work. Yes, you can re-enable the main window and unfreeze it using AutoHotkey. However, regarding message pumps in GUI programs, you should understand that the main window's message pump is associated with the main thread which is blocked waiting for the dialog to terminate. New event messages coming to the main window will not be treated because there is no thread to handle them, so they will just be queued. You would be entering values that are not checked and clicking buttons with delayed action, with effects that are not easy to predict.
    – harrymc
    Commented Jun 16, 2020 at 9:39
  • Understand also that the queued events are not necessarily presented to the message pump in the order in which they occurred. You might for example deblock the main window and type a value into a field and click a button, to find that the click was processed before the value was changed, with wrong results. It would be pretty hard in such case to understand why the program was misbehaving.
    – harrymc
    Commented Jun 16, 2020 at 9:52
  • 1
    It's the operating system that does it, not Java or C or any library. And yes, the modal dialog starts a new message pump serviced by a new thread (it has to, as the old one is blocked). Some events that arrive at the blocked message pump are still serviced, not all are queued. The same mechanism is used as for recursive procedure calls, so the old event call is kept on the stack for the duration while the same thread handles the new event. There is no documentation about what the behavior of different calls is in such a situation.
    – harrymc
    Commented Jun 16, 2020 at 11:22
  • 1
    In any case, the answer to your question is : You can re-enable the main window and unfreeze it using AutoHotkey or similar. How well the deblocked window will work is unknown, needing experimenting per each case.
    – harrymc
    Commented Jun 16, 2020 at 11:24