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;
       }
}
----- Original Message -----
From: Steve
Sent: Wednesday, November 27, 2002 8:18 PM
Subject: Preventing IE close

I am using Win32::OLE to display some analysis results in an Internet Explorer window.  I want to have the same window available for display of different results, so I want the user to be able to minimize it but not close the window. Is there a way I can eliminate the close button, or maybe trap the event it generates and make that event minimize the window instead? 
 
Steve

Reply via email to