#! usr/bin/perl #use Win32::Gui; use Win32::GuiTest qw(:ALL); use strict; my $window = FindWindowLike( undef,"Setup","" ); while( $window = FindWindowLike( undef,"Setup","" )) { SetForegroundWindow($window); my @hwnds = FindWindowLike(GetChildWindows($window)); #my @hwnds = GetChildWindows($window); foreach (@hwnds) { #SetActiveWindow($_); GetFocus($_); my $WinTxt = GetWindowText($_); print $WinTxt; print "\n"; my $class = GetClassName($_); print $class; if($class =~ /^(TNewRadioButton|radiobutton|Radiobutton|RadioButton|Button|TRadioButton)$/) { my $id=GetWindowID($_); my $text = WMGetText($_); #my $wintxt=GetWindowText($child); if ($text =~ /^(I &accept the agreement|agree|Agree|Accept|I agree to the terms of this license agreement|Install|install|I accept the license agreement|I &accept the terms in the License Agreement)$/) { CheckButton($id) || MouseClick($id); #SendKeys($child); #SendKeys("~"); #PushButton("Next"); } } if($class =~ /^(Checkbox|checkbox|TNewCheckListBox|CheckListBox|CheckBox|Button|button|TRzCheckBox)$/) { my $id=GetWindowID($_); my $text = WMGetText($_); #my $wintxt=GetWindowText($id); #print $id; #print "\n"; CheckButton($id) || MouseClick($id); #SendKeys($_); #if ($text =~ /^(I &accept the agreement|agree|Agree|Accept|I agree to the terms of this license agreement|Install|install| I accept the license agreement)$/) #{ #MouseClick($id) && CheckButton($id); #CheckButton($id); #|| MouseClick($id); #PushButton("Next"); #} } if($class =~ /^(Button|button|TNewButton|TButton|&Button)$/) { my $id=GetWindowID($_); my $text = WMGetText($id); #my $wintxt=GetWindowText($id) if($text !~ /^(Cancel|cancel|back|Back|&Back|&Cancel|&