amysue Posted January 6, 2014 Share Posted January 6, 2014 Hi, I'm using activex in perl, I want to maximize firefox window when run C:Program FilesMozilla Firefoxfirefox.exe. But the firefox is NOT launched by using $Au3->Run($exe, "", "SW_MAXIMIZE"); the firefox is launched by $Au3->Run($exe); The firefox is launched but not default maximize. The completely code is below use strict; use warnings; use Win32::OLE; use Getopt::Long; my ($rc, $browser, $ip, $num, $exe); $browser = 'firefox'; $ip = '11.11.11.200:4433'; $num = 10; $rc = GetOptions ( "b=s" => \$browser, "i=s" => \$ip, "n=s" => \$num, ); if ($browser eq 'firefox') { $exe = 'C:\Program Files\Mozilla Firefox\firefox.exe'; } print "exe is ". $exe . "\n"; Win32::OLE->Initialize(Win32::OLE::COINIT_OLEINITIALIZE()); my $Au3 = Win32::OLE->new("AutoItX3.Control") or die "AutoIT dll not installed\n"; $Au3->Run($exe, "", "SW_MAXIMIZE"); sleep 5; Link to comment Share on other sites More sharing options...
Richard Robertson Posted January 6, 2014 Share Posted January 6, 2014 You aren't supposed to send a string for that parameter. It should be the value $Au3->SW_MAXIMIZE. Link to comment Share on other sites More sharing options...
amysue Posted January 7, 2014 Author Share Posted January 7, 2014 You aren't supposed to send a string for that parameter. It should be the value $Au3->SW_MAXIMIZE. Thanks, use $Au3->SW_MAXIMIZE solve my problem. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now