#!/usr/bin/perl -w #enable-s-video.pl use strict; use Win32::GuiTest qw(FindWindowLike GetWindowText GetForegroundWindow SetForegroundWindow SendKeys); sub waitForSeconds { select(undef, undef, undef, $_[0]); } system("start ControlPanel-Display"); waitForSeconds(0.3); my ($hwindDisplay) = FindWindowLike(0, "^Display Properties", ""); $hwindDisplay or die("Could not open Control Panel - Display\n"); SetForegroundWindow($hwindDisplay); #Settings Tab SendKeys("^+{TAB}"); #Advanced Button SendKeys("%v"); #Dusplays Tab SendKeys("^{TAB}") for(1..5); #Move to the bottom of the Scheme combobox SendKeys("{DOWN}") for(1..10); #OK Button SendKeys("{ENTER}"); #Leave it time to change mode waitForSeconds(1); #Did we change the settings? Then we need to confirm the dialog box. SendKeys("{TAB}{SPACEBAR}") if(GetWindowText(GetForegroundWindow()) =~ /^ATI Property Page/); #Close dialog SetForegroundWindow($hwindDisplay); SendKeys("{ENTER}"); __END__