Hello, I am using automation of Internet Explorer to navigate to particular
web pages. However, I would like the IE window to contain no frills - i.e.,
no address bar, no menu bar, no scroll bars, etc. I can get rid of most of
these things, but I am having a problem suppressing the scrollbars of a
window. The following is a perl script which will bring up an IE window and
you will see that a vertical scroll bar remains. I try suppressing it using
Win32::API and calling the Win32 functions EnableScrollBar and
ShowScrollBar, but I've had no luck so far. Any suggestions?
Thanks,
Carl Erikson
PS - This script requires Tk, Win32::API, Win32::OLE, Win32::OLE::Const
----------------------------------------------------------------------------
-----------------------
# Opens up an instance of MSIE and navigates to a particular web page. I
would
# like the web page to not show a vertical scrollbar but my attempts at
# supressing it have failed.
use Tk;
use Win32::API;
use Win32::OLE;
use Win32::OLE::Const;
my $SB_BOTH = 3;
my $ESB_DISABLE_BOTH = 3;
my $ShowScrollBar = new Win32::API( "User32", "ShowScrollBar",
['N', 'I', 'I'], 'I' );
my $EnableScrollBar = new Win32::API( "User32", "EnableScrollBar",
['N', 'I', 'I'], 'I' );
my $ie = Win32::OLE->new( 'InternetExplorer.Application',
sub{ $_[0]->Quit; } )
|| die "Cannot start InternetExplorer";
# Change properties of IE so that you get a basic window with no frills
$ie->{ 'menubar' } = 0;
$ie->{ 'addressbar' } = 0;
$ie->{ 'toolbar' } = 0;
$ie->{ 'statusbar' } = 0;
$ie->{ 'resizable' } = 0;
$ShowScrollBar->Call( $ie->{ 'hwnd' }, $SB_BOTH, 0 );
$EnableScrollBar->Call( $ie->{ 'hwnd' }, $SB_BOTH, $ESB_DISABLE_BOTH );
$ie->{ 'width' } = 290;
$ie->{ 'height' } = 571;
$ie->{ 'visible' } = 1;
# Load InternetExplorer constants
my $const = Win32::OLE::Const->Load( $ie );
$ie->Navigate( "http://www.isld.com/BookViewer/javabook.htm" );
# Wait for the page to finish downloading
while ($ie->{ ReadyState } != $const->{ READYSTATE_COMPLETE }) {};
# Tk stuff
my $win = MainWindow->new;
$win->geometry( "=+0+0" );
$win->title( "Ex" );
my $button = $win->Button( "-text" => "Exit",
"-width" => 10,
"-height" => 2 );
$button->bind( "<ButtonRelease-1>", \&Exit );
$button->OnDestroy( \&DestroyExit );
$button->pack;
# Start Tk
MainLoop;
# The exit button was pressed
sub Exit {
# Must call the Tk version of exit
Tk::exit;
}
# Clean up IE
sub DestroyExit {
$ie->Quit();
}
_______________________________________________
Perl-Win32-Web mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-web