I've tried using Sys.Desktop.ActiveWindow, however, I got similar results as previously.
The progress dialog I am trying to pick up should be displayed for a minimum of 2 seconds, however, if a large file is being processed it will display for longer.
In the 2 second example Sys.Desktop.ActiveWindow only seems to pick up the parent window and not the progress dialog.
In the example where it is processing for longer (and the progress dialog is displayed for longer) Sys.Desktop.ActiveWindow will pick up the progress dialog and I am able to calculate the display time.
Repeatedly logging the return value from Sys.Desktop.ActiveWindow.Name after clicking the button shows that script is being executed quick enough to pick up the progress dialog (i.e. well within 2s of clicking the button) it just doesn't seem to realise that the progress dialog is there.
I guess, the progress dialog opens after your test executes a click in your application.
Try replacing the Click call with the MouseDown + MouseUp calls. The point here is that the Click method's logic performs some checks to make sure that the application received the click, and this logic may take some time. At that, the MouseDown and MouseUp calls do not perform this check, so, this may help you accomplish your task. Please note that you will probably need to put a small delay between the calls.