From: Robert M. <rob...@us...> - 2008-02-08 18:39:14
|
On 08/02/2008, Perl Rob <pe...@co...> wrote: > Is Win32::GUI() capable of creating a marquee-style progress bar for > indicating activity instead of overall progress? Yes, it's possible. It will only work on WinXP and later, as it requires the (non-distributable) ComCtl32.dll V6 and above. (1) You need perl to use a manifest to request to use the v6 ComCtl32.dll. The easiest way to do this is to drop a manifest file into you perl bin/ directory (the diretory containing your perl.exe. I'll attach the manifest file I use. It must be named perl.exe.manifest (with the perl.exe part changed if you have a perl executable by a different name) (2) You need to add the PMS_MARQUEE style to the progress bar. See code below. As an aside I notice that all the PBS_ and PBM_ constants are missing from Win32::GUI::Constants - I'll add them for the next release. Regards, Rob. #!perl -w use strict; use warnings; use Win32::GUI 1.05 qw(CW_USEDEFAULT); sub PBS_MARQUEE() {0x08} my $mw = Win32::GUI::Window->new( -title => 'WinXP Marquee Progress Bar', -left => CW_USEDEFAULT, -size => [200,150], ); my $pb = $mw->AddProgressBar( -pos => [10,10], -size => [150,22], -addstyle => PBS_MARQUEE, ); $mw->AddTimer('T1', 300); $mw->Show(); Win32::GUI::Dialog(); $mw->Hide(); exit(0); sub T1_Timer { $pb->StepIt(); } __END__ |