use strict; use Win32; use Win32::GuiTest qw(:ALL); sub ConfirmUI { my $searchString = shift; my $uiFound = 0; for (FindWindowLike()) { my $title = GetWindowText($_); next unless ( $title ); if( $title =~ /$searchString/ ) { $uiFound = 1 } last if ( $uiFound >= 1 ); } return( $uiFound ); }