#!perl -w use strict; use warnings; # # Hosting a WebBrowser # Create a WebBrowser and register an event. # Enumerate Property, Methods and Events and create a Html file. # Load Html file in WebBrowser. # use File::Temp(); use Win32::GUI qw(WS_CLIPCHILDREN); use Win32::GUI::AxWindow(); # main Window my $Window = Win32::GUI::Window->new( -title => "Win32::GUI::AxWindow WebBrowser", -pos => [100, 100], -size => [400, 400], -name => "Window", -pushstyle => WS_CLIPCHILDREN, ) or die "new Window"; # Create AxWindow my $Control = new Win32::GUI::AxWindow ( -parent => $Window, -name => "Control", -pos => [0, 0], -size => [400, 400], -control => "Shell.Explorer.2", # -control => "{8856F961-340A-11D0-A96B-00C04FD705A2}", ) or die "new Control"; # Register Event $Control->RegisterEvent("StatusTextChange", sub { my($self,$id, @args) = @_; print "Event : ", @args, "\n"; } ); # Enum Property info my $tmp = File::Temp->new(SUFFIX => ".html"); print "writing to file: $tmp\n"; print $tmp "\n"; print $tmp "
\n";
foreach my $key (keys %property) {
print $tmp "$key = $property{$key}
\n";
}
print $tmp "
\n";
foreach my $key (keys %method) {
print $tmp "$key = $method{$key}
\n";
}
print $tmp "
\n";
foreach my $key (keys %event) {
print $tmp "$key = $event{$key}
\n";
}
print $tmp "