Thanks for the information. For some reason I had to use both –popstyle  (WS_CAPTION | WS_THICKFRAME) and –pushstyle (WS_POPUP) to get it to work.



From: Kevin Marshall []
Sent: Friday, March 05, 2010 9:54 PM
To:; Perl-Win32-GUI-Users List
Subject: RE: [perl-win32-gui-users] Borderless Main Window


Instead of using -pushstyle, you need to use -popstyle. As for the constants needed, you will need to use WS_CAPTION to remove the title bar and WS_THICKFRAME to remove the window's sizing border. Here is an example:
$splash = Win32::GUI::Window->new(
  -name => 'splash',
  -size => [200,200],
  -popstyle => WS_CAPTION | WS_THICKFRAME,
There are a number of other window constants that can be used when creating a splash window. If you have the Windows SDK, you can check the documentation for a full list.
Hope this helps,

Date: Fri, 5 Mar 2010 14:44:24 -0500
Subject: [perl-win32-gui-users] Borderless Main Window


Let me preface my question by saying that I haven’t used Win32::GUI very much, so I might be missing something obvious.


I want to create a borderless window (splash screen) and have done so using the –style option when creating the new window.

Unfortunately, this option is deprecated, and I get a message informing me of that fact whenever I run the application.

Looking at the documentation, it appeared that I could use the –pushstyle of –addstyle option when creating the window. However, the window has a border when either of these options is used.

Can anyone point out the error of my ways?  Actual code is below.

Thanks, Ken Slater


use strict;

use warnings;

use File::Basename;

use Getopt::Long;

use Win32::API;

use Win32::GUI();

use Win32::GUI::Constants;


use Win32::OLE('in');


my ( $runDir );



   $runDir = Win32::GetFullPathName(dirname($0));



my ($help, %options, %overridingOptions);

$options{iniFile} = "$runDir/stayOnTop.ini";



my ($execname) = fileparse( "$0", '' );


sub usage


    print STDERR <<USAGE;


$execname ...



    return 0;

} # end sub usage



GetOptions( "ini=s"   => \$options{iniFile},

            "bg=s"    => \$overridingOptions{backgroundFile},

            "t=i"     => \$overridingOptions{timeout},

            "h!"      => \$help,

            "help!"   => \$help);

if ( $help )



   exit 0;





use constant wbemFlagReturnImmediately => 0x10;

use constant wbemFlagForwardOnly => 0x20;



#  Get height and width of display


my $computer = ".";

my $objWMIService = Win32::OLE->GetObject


   or die "WMI connection failed.\n";

my $colItems = $objWMIService->ExecQuery

    ("SELECT * FROM Win32_VideoController","WQL",

     wbemFlagReturnImmediately | wbemFlagForwardOnly);


my ( $screenWidth, $screenHeight );


foreach my $objItem (in $colItems)


      $screenWidth  = $objItem->{CurrentHorizontalResolution};

      $screenHeight = $objItem->{CurrentVerticalResolution};




#  Create GUI Window


my $WS_POPUP = Win32::GUI::Constants::constant('WS_POPUP');

my $mw = Win32::GUI::Window->new(

                -title => 'NOBORDER (I hope)',

        -bg  => 'black',

                -pos => [0,0],

                -size => [$screenWidth,$screenHeight],

        #  The -stype option was added to make borderless

        #  windows. Get a warning that this option is deprecated.

        -style => $WS_POPUP,


        #  Neither addstyle or pushstyle seem to get rid of the border

        #-addstyle  => $WS_POPUP,

        #-pushstyle => $WS_POPUP,




#  Force this window to stay on top of other windows.


my $HWND_TOPMOST = Win32::GUI::Constants::constant('HWND_TOPMOST');

my $SWP_NOSIZE   = Win32::GUI::Constants::constant('SWP_NOSIZE');

my $SWP_NOMOVE   = Win32::GUI::Constants::constant('SWP_NOMOVE');






#  Set the timer to exit this application after the specified

#  number of milliseconds.


$options{timeout} = 5000 unless defined($options{timeout});

my $t1 = $mw->AddTimer('T1', $options{timeout});



#  Set up the image to be displayed on the screen


my $bitmap = Win32::GUI::Bitmap->new($options{backgroundFile},



#create a label in which the bitmap will be placed

my $bitmapLabel = $mw->AddLabel(

    -name     => "Bitmap",

    -left     => 0,

    -top      => 0,

    -width    => $screenWidth,

    -height   => $screenHeight,

    -bitmap   => $bitmap,




#  Display the window






# Subroutine called when timer expires


sub T1_Timer





sub pullSettings


   local $/ = undef;

   open my $INIFH, '<', $options{iniFile} or do


      Win32::MsgBox("FATAL: Unable to open $options{iniFile}: $^E",

                    0, "");



   my $lines = <$INIFH>;

   close $INIFH;


   my $re = qr{<([^/][^>]+)>\s*([^<]+)};

   %options = $lines =~ /$re/gs;


   foreach my $key ( keys %options )


      $options{$key} = $overridingOptions{$key}

         if defined($overridingOptions{$key});




Find out now. Link all your email accounts and social updates with Hotmail.