This is a sub I use frequently that uses the Win32::GuiTest module to get all the window titles from the system, and verify a certain window title is present.
Returns true if window title is present, false if not
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 ); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Confirm an application opens (win32)
by liverpole (Monsignor) on Aug 13, 2007 at 21:23 UTC | |
by bobf (Monsignor) on Aug 14, 2007 at 02:32 UTC | |
by technojosh (Priest) on Aug 13, 2007 at 21:48 UTC |