Jump to content

how to maximize firefox window by using AutoitX in perl


amysue
 Share

Recommended Posts

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...