You can catch the "close" event, and then reopen
IE:
Try something like this (you can also use the
EventLoop but I didn't managed to make it work) :
my $Quit = 0;
use Win32::OLE qw(EVENTS);
$IE =
Win32::OLE->new("InternetExplorer.Application.1") or die "Impossible de creer
l'OLE InternetExplorer";
$IE->Navigate("http://".$adresse); $IE->{'Visible'} = 1; Win32::OLE->WithEvents( $IE, \&Event, 'DWebBrowserEvents' ); $Quit = 0; for (;;) {
$adresse =
$IE->{LocationURL};
# Do what you want (you would
better add a pause like select(undef,undef,undef,0.001) to prevent any CPU
overload)
Win32::OLE->SpinMessageLoop; } sub Event {
my ( $Obj,$Event,@Args ) = @_; #print "Event triggered: '$Event'\n"; if ($Event eq "Quit") {
$IE =
Win32::OLE->new("InternetExplorer.Application.1") or die "Impossible de creer
l'OLE InternetExplorer";
$IE->Navigate("http://".$adresse); $IE->{'Visible'} = 1;
}
}
|
- Re: Preventing IE close Thomas Drugeon
- Re: Preventing IE close Thomas Drugeon
- Re: Preventing IE close Steve