Win32::GUI::AxWindow - Host ActiveX Controls in Win32::GUI windows |
Win32::GUI::AxWindow - Host ActiveX Controls in Win32::GUI windows
use Win32::GUI(); use Win32::GUI::AxWindow;
# Main Window $Window = new Win32::GUI::Window( -name => "Window", -title => "Win32::GUI::AxWindow test", -pos => [100, 100], -size => [400, 400], );
# Add a WebBrowser AxtiveX $Control = new Win32::GUI::AxWindow ( -parent => $Window, -name => "Control", -control => "Shell.Explorer", -pos => [0, 0], -size => [400, 400], );
# Register some event $Control->RegisterEvent("StatusTextChange", sub { $self = shift; $eventid = shift; print "Event : ", @_, "\n"; } );
# Call Method $Control->CallMethod("Navigate", 'http://www.perl.com/');
# Event loop $Window->Show(); Win32::GUI::Dialog();
# Main window event handler
sub Window_Resize { if (defined $Window) { ($width, $height) = ($Window->GetClientRect)[2..3]; $Control->Move (0, 0); $Control->Resize ($width, $height); } }
new
(...)options :
-parent => parent window (Required) -name => window name (Required) -size => window size [ width, heigth ] -pos => window pos [ left, top ] -width => window width -height => window height -left => window left -top => window top -control => clisd (see below) (Required).
clsid
is a string identifier to create the control.
Must be formatted in one of the following ways:
- A ProgID such as "MSCAL.Calendar.7" - A CLSID such as "{8E27C92B-1264-101C-8A2F-040224009C02}" - A URL such as "http://www.microsoft.com" - A reference to an Active document such as 'file://Documents/MyDoc.doc' - A fragment of HTML such as "MSHTML:<HTML><BODY>This is a line of text</BODY></HTML>"
Note that ``MSHTML:'' must precede the HTML fragment so that it is designated as being an MSHTML stream.
styles:
-visible => 0/1 -tabstop => 0/1 -hscroll => 0/1 -vscroll => 0/1
-style, -addstyle, -pushstyle, -remstyle, -popstyle -exstyle, -exaddstyle, -expushstyle, -exremstyle, -expopstyle
Default style is : WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_CLIPCHILDREN
Release
()Win32::GUI::Dialog();
exits).
Generaly, call this function in the Window_Terminate event handler.
EnumPropertyID
()EnumPropertyName
()GetPropertyInfo
(ID_or_Name)ID_or_Name
.
Hash entry :
-Name => Property Name. -ID => Property ID. -VarType => Property Type (Variant type). -EnumValue => A formated string of enum value ( enum1=value1,enum2=value2,... ). -ReadOnly => Indicate if a property can only be read. -Description => Property Description. -Prototype => Prototype
GetProperty
(ID_or_Name, [index, ...])SetProperty
(ID_or_Name, [index, ...], value)
EnumMethodID
()EnumMethodName
()GetMethodInfo
(ID_Name)Hash entry :
-Name => Method Name. -ID => Method ID. -Description => Method Description. -Prototype => Method Prototype.
CallMethod
(ID_or_Name, ...)
EnumEventID
()EnumEventName
()GetEventInfo
(ID_or_Name)ID_or_Name
.
Hash entry :
-Name => Method Name. -ID => Method ID. -Description => Method Description. -Prototype => Method Prototype.
RegisterEvent
(ID_or_Name, Callback)
GetOLE
()You MUST add use Win32::OLE;
in your script.
Laurent Rocher (lrocher@cpan.org)
Win32::GUI http://perl-win32-gui.sourceforge.net/
This module requires these other modules and libraries:
Copyright 2003 by Laurent Rocher (lrocher@cpan.org)
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
See http://www.perl.com/perl/misc/Artistic.html
Win32::GUI::AxWindow - Host ActiveX Controls in Win32::GUI windows |