#! C:/perl/bin/perl use strict; use warnings; # Win32::GuiTest doesn't like -w use Win32::GuiTest qw(FindWindowLike SetForegroundWindow SendKeys PushButton); my @windows = FindWindowLike(0, "^Calculator"); # find all calculator windows die "Start Calc before running this example.\n" unless @windows; my $hwnd = $windows[0]; # we'll just the first match SetForegroundWindow($hwnd); # Bring it the foreground SendKeys("%VS"); # switch to scientific mode # press these buttons foreach my $button ("Hex", "Dec", "Oct", "Bin") { sleep(2); PushButton($button); }