$|++; use strict; use Win32; use Win32::GuiTest qw(:ALL :SW); use vars qw /%data/; #$data{apps_list} = shift @ARGV; $data{host} = Win32::NodeName(); system (cls); my @windows = FindWindowLike(0, 'Clean Spooler'); 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 next if ($text =~ /^OK|Cancel|Abort|Retry|Ignore|Yes|No$/); # you've found a button print "Found child $child with text '$text'\n"; } }