From: "Chris Wearn" <[EMAIL PROTECTED]>
I have a rather large GUI app that can take 20 seconds or more to load,
once
turned into an executable using ActiveStates PerlApp 5.2
During this time I wish to display a splash screen, provided by a
preliminary exe, which launches the main application exe, then dies once
the
main exe is visible... similar to a lot of other major applications.
Hi,
The way I do this is to have a small program (see below) that displays the
splash, and then performs an eval which brings the rest of the application
into scope. In my case the splash is displayed within a second (even on a
slow machine), and I set a timer that removes the splash 1 second after the
main window is displayed. The build and initialisation process takes
anywhere between 3 and 30 seconds depending on the machine and user options
- the splash is displayed during this process.
If you have any more questions, just email.
Cheers,
jez.
============================
use strict;
use Win32::GUI;
use Win32::GUI::AdHoc;
use Win32::GUI::BorderlessWindow;
use Win32::GUI::DIBitmap;
use Cwd;
my $splashimage = newFromFile
Win32::GUI::DIBitmap(cwd.'\Resource\splash.png');
my $width = $splashimage->Width;
my $height = $splashimage->Height;
my $splash = new Win32::GUI::BorderlessWindow (
-name => "Splash",
-text => "Splash",
-height => $height,
-width => $width,
-left => 100,
-top => 100,
-topmost => 1,
-addexstyle => 0x00000080
);
Win32::GUI::AdHoc::windowCenter($splash);
$splash->Show();
my $splashdc = $splash->GetDC;
$splashimage->CopyToDC($splashdc,0,0,600,600,0,0);
$splash->DoEvents();
undef($splashimage);
my $string='use Client::MainApp;
Client::MainApp::Init();
Client::MainApp::Go($splash);
';
eval $string;
if ($@) {
#report error to user
my $message = $@;
Win32::GUI::MessageBox($splash, $message ,"Build Error", MB_OK |
MB_ICONWARNING);
print $message;
}
_________________________________________________________________
Find a cheaper internet access deal - choose one to suit you.
http://www.msn.co.uk/internetaccess