Hi

Recently I have been posting (under my name and anonymously because I forgot to log in) a bout a problem I was having with detecting a popups. The good news I have cracked it. Many thanks for the Monks here whom helped me and specially to Ven'Tatsu and the pseudo code he provided me with which I based my solution on it.

As it is customary here, I am posting the full code for the benefit of all PRELovers.

Hmmmm, Maybe I shouldn't post this here (seekers of Perl wisdom) perhaps one of the Gods here will move to more appropriate area - Please do inform where these completed codes should go.

Thanks

Blackadder
#! c:/perl/bin $|++; AUTOLOAD; require 5.008; use strict; use Win32; use threads qw[yield]; #let us make threads use threads::shared; # lets share vars between threads use thread::Queue; use POSIX qw [_exit]; use Win32::OLE qw[in with]; use Win32::GuiTest qw (:ALL :SW); use vars qw/%data/; use time::HiRes qw(sleep); my $watcher = threads->create("Watcher"); my $job_done:shared=0; system(); # Do what ever you like here and its popups will be monitore +d. $job_done = 1; my $error = $watcher->join; sub Watcher { my $watch_error = 0; until ($job_done) { print "I am here\n"; my @windows = FindWindowLike(0,'GO'); for my $win (@windows) { print "Found $win =>". GetWindowText($win). "\n"; my @children = GetChildWindows($win); for my $child (@children) { my $text = GetWindowText($child); next if ($text =~ /^\xff/); if ($text =~ /^OK$/i) { print "FOUND IT ==> Child : $child, Text : $text\n +\n"; $watch_error = 1; _exit 0; } } } sleep 1; } return $watch_error; }