in reply to Win32::Process handling
How does the process report the error? Does it create a file somewhere? Or does it show a dialog box? Does it write something to STDERR?
If the first, you only need a loop similar to this:
my $loopcount = 0; 1 while (! $process->Wait(1000) and ! -e $the_file and $loopcount++ < +$timeout); if ($loopcount >= $timeout) { ... fead up with waiting. } elsif (-e $the_file) { ... it errored out } else { ... it did its work }
In the second case you should try it Win32::GuiTest's FindWindowLike() sees that error message box and then the loop will be similar. Just instead of -e $the_file you'll have something like FindWindowLike(0, "^My program error", undef). Plus maybe it'll be better if you find the main program window first and then only search among its children.
In the third case you'll have to
I can go into more detail on the 2nd and 3rd if that is what you need.
Jenda@Krynicky.cz
|
|---|