> Hello,
>
> >      See attached sample.
> >
> >  Laurent.
>
>   I am sorry, but probably do you forget to send attachment( with sample)?
>
    I send sample as attached zip file (?).  See below.

Laurent
-----------------------------------------------
# perl -v
#
#  Hosting WebBrowser
#
use Win32::GUI;
use Win32::OLE;
use Win32::GUI::AxWindow;

# main Window
$Window = new Win32::GUI::Window (
    -title    => "Win32::GUI::AxWindow and Win32::OLE",
    -pos     => [100, 100],
    -size    => [400, 400],
    -name     => "Window",
) or die "new Window";

# Create AxWindow
$Control = new Win32::GUI::AxWindow  (
               -parent  => $Window,
               -name    => "Control",
               -pos     => [0, 0],
               -size    => [400, 300],
               -control => "Shell.Explorer.2",
 ) or die "new Control";

# Get Ole object
my $html = '<html><body><a
href="http://www.perl.com";>perl.com</a></body></html>';
$OLEControl = $Control->GetOLE();
$OLEControl->Navigate("about:blank");  # Clear control
$OLEControl->{Document}->write($html); # Write Html

# Event loop
$Window->Show();
Win32::GUI::Dialog();

# Main window event handler
sub Window_Terminate {
  # Release all before destroy window
  undef $OLEControl;
  $Control->Release();
  return -1;
}

sub Window_Resize {
  if (defined $Window) {
    ($width, $height) = ($Window->GetClientRect)[2..3];
    $Control->Resize ($width, $height);
  }
}



Reply via email to