slloyd has asked for the wisdom of the Perl Monks concerning the following question:
#!perl use strict; use Win32::GUI; use Win32::GUI::AxWindow; ################ MAIN WINDOW ############# my $FormWindow = new Win32::GUI::Window( -name => "FormWindow", -text => "Test", -pos => [0,0], -size => [400,300], ); sub FormWindow_Resize{return 0;} sub FormWindow_Minimize {return 0;} sub FormWindow_Maximize {return 0;} sub FormWindow_Terminate {return -1;} ########################## # Add a WebBrowser AxtiveX my $Control = new Win32::GUI::AxWindow ( -parent => $FormWindow, -name => "Control", -control => "Shell.Explorer.2", #-control => "InternetExplorer.Application", #-control => "{8856F961-340A-11D0-A96B-00C04FD705A2}", -pos => [0, 0], -size => [400, 300], ); # # Register some event # When I try to register the following events, Perl blows up. # NavigateComplete2 # BeforeNavigate2 # NewWindow2 # These events work though # DownloadBegin # DocumentComplete # StatusTextChange $Control->RegisterEvent("StatusTextChange", sub { my $self = shift; my $eventid = shift; my $str=shift; print "Event [$eventid]: ", $str, "\n" if length($str) && $str + !~/done/is; } ); print "Calling Navigate\n"; # Call Method $Control->CallMethod("Navigate", 'http://www.google.com'); print "Done\n"; ########################## $FormWindow->Show(); Win32::GUI::Dialog(); exit;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Capturing a browser event in an ActiveX Browser Window
by tachyon (Chancellor) on Jun 15, 2004 at 09:08 UTC | |
|
Re: Capturing a browser event in an ActiveX Browser Window
by dimar (Curate) on Jun 15, 2004 at 05:03 UTC | |
by Anonymous Monk on Jun 15, 2004 at 09:23 UTC |