Not sure if anyone really cares, but recent builds of Mozilla have
options to allow ActiveX controls.  The binaries for Windows have this
build option on, but you have to install a plug-in to use it:

http://www.iol.ie/~locka/mozilla/mozilla.htm

Basically, in the below script, you can substitute
"MozillaBrowser.Application" in the control name.  I did have some
problems with a few of the events and stuff, but I also had the same
issues with InternetExplorer.Application, so it could be something flaky
on this machine.

Just an FYI for those who would be interested in getting Mozilla into an
Win32::GUI application via AxWindow.

Joe Frazier, Jr.
Senior Support Engineer

Peopleclick Service Support
Tel:  +1-800-841-2365
E-Mail: [EMAIL PROTECTED] 

> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On 
> Behalf Of Laurent ROCHER
> Sent: Tuesday, March 30, 2004 1:30 PM
> To: [EMAIL PROTECTED]; perl-win32-gui-users@lists.sourceforge.net
> Subject: Re: [perl-win32-gui-users] Internet explorer, 
> AxWindow, WIN32::OLE
> 
> Hi
> 
> >I am playing win Internet explorer in the 
> Win32::HUI::AxWindow and OLE.
> >Downloading and displaying pages looks good and easy, howevere I can 
> >not
> figure out
> >if the page has frames how do I treat these frames, means, 
> first , how 
> >do I know if the page has frames or not, and if it has 
> frames, how do I 
> >get the html code, the page source of each frame and how do 
> I know when 
> >all frames are fully loaded.
> 
> For know your page have frame you first need to wait at least 
> first page is load.
> See sample below.
> 
> >Is there a docs anywhere on the properties and methods tree of the 
> >object
> 
> Look in MSDN :
> For WebBrowser :
> http://msdn.microsoft.com/workshop/browser/webbrowser/browser_
> control_node_entry.asp
> 
> Search IWebBrowser2 and DWebBrowserEvents2 COM interface reference.
> 
> For MSHTML and HTMLDocument :
> http://msdn.microsoft.com/workshop/browser/mshtml/reference/re
ference.asp
Search IHTMLDocument2.

>Also what is the difference between, DocumentComplete and 
>DownloadComplete
events

DocumentComplete is fire Fires when a document has been completely
loaded and initialized.
In pages with no frames, this event fires once after loading is
complete.
In pages where multiple frames are loaded, this event fires for each
frame.

DownloadComplete Fires when a downloading operation finishes.
See DWebBrowserEvents2.

Laurent

-------------------------------------

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    => [600, 600],
     -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",
                -visible => 1,

 ) or die "new Control";

# Get Ole object
$OLEControl = $Control->GetOLE();
$Control->RegisterEvent ("DocumentComplete", "DocumentComplete_Event" );

$Window->Show();

my $MyURL = "http://wp.netscape.com/assist/net_sites/example1-F.html";;
$Control->CallMethod("Navigate", $MyURL);

# Wait first loading end for determinate frame number while
(Win32::GUI::DoEvents() != -1 && $Control->GetProperty("Busy")) {}

my $Length = $OLEControl->{Document}->{frames}->length;
print "This document have $Length Frame or iFrame\n";

Win32::GUI::Dialog();

# Main window event handler
sub Window_Terminate {
   undef $OLEControl;
   return -1;
}

sub DocumentComplete_Event {
  my ($Obj, $EventID, $Document, $URL) = @_;
  # Finish a URL (Document or a frame)
  print "Done URL: ", $URL, "\n";
  # Finish load complete document
  if ($URL eq $Control->GetProperty("LocationURL")) {
    print "Document complete\n";
    my $length = $OLEControl->{Document}->{frames}->length;
    my $i = 0;
    while ($i < $length) {
      print "Frame $i\n";
      my $frame = $OLEControl->{Document}->{frames}->item($i);
      print $frame->{Document}->{body}->outerHTML, "\n";
      $i ++;
    }
  }
}



-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux
tutorial presented by Daniel Robbins, President and CEO of GenToo
technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
Perl-Win32-GUI-Users mailing list
Perl-Win32-GUI-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users




Reply via email to