in reply to How to Retrieve another Process' Window Title?
Just for completeness, I thought I'd drop through a note to say that the job monitoring is working well at present... *fingers' crossed*...
Here's the segment of code where all the magic happens:-
use Win32::GuiTest qw(FindWindowLike GetWindowText); [...] sub Check_Job { my ($site_num) = @_; my ($buf, $num_windows); my (@windows); $buf = sprintf("^%s - Socks", $site_num); @windows = FindWindowLike(0, $buf); $num_windows = @windows; if ($num_windows == 0) { # NO WINDOWS! Need to resubmit $st = 0; } elsif ($num_windows != 1) { # MULTI-WINDOWS! Oops!! printf("%s: WARNING: There are %d Socks windows for site %d!!!\n +", $my_proc, $num_windows, $site_num); $st = 2; } else { # ONE-ONLY WINDOW - GOOD! $st = 1; } return($st); } # end Check_Job
Many thanks, once again, for everyone's help.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to Retrieve another Process' Window Title?
by Anonymous Monk on Feb 10, 2011 at 22:50 UTC |