# popup.pl use Win32; Popup('testing popup detection...', 16, 'Some popup title'); sub Popup { my ($msg, $flags, $title) = @_; return Win32::MsgBox($msg, $flags, $title); die $msg; } #### # findpopup.pl use Win32::GuiTest qw(:ALL :SW); my @windows = FindWindowLike(0, 'Some popup title'); 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"; } }