$|++; use strict; use Win32; use Win32::GuiTest qw(:ALL :SW); use vars qw /%data/; system (cls); $data{apps_list} = shift @ARGV; $data{host} = Win32::NodeName(); print "\nThis machine is ". $data{host}; print "\n\nPath to apps list => ". $data{apps_list}."\n"; open (LST, "$data{apps_list}") || die "$! : File was not found\n"; chomp (@{$data{Go_scripts}} = ); for my $item (@{$data{Go_scripts}}) { System ($item); Print "Testing => $item\n"; # # some code needs to be here to detect the popup! # Win32::AbortSystemShutdown($data{host}); } #### While (1) { my @windows = FindWindowLike(0, 'MYPOPUP'); for my $win (@windows) { print "Found window $win with title '", GetWindowText($win), "'\n"; my @children = GetChildWindows($win); for my $child (@children) { my $text = GetWindowText($child); next if ($text =~ /^\xff/); # you've found the icon print "Found child $child with text '$text'\n" if ($text =~ /^OK$/)}}}