Hi Tony,

Thanks for the wxPython code. My reason for wanting to avoid
wxPython (and pyQt) is that I don't want to ship the wxPython
framework just to display a splash screen. I believe this might
triple the size of my PY2EXE generated executables - not a
worthwhile tradeoff for a cosmetic feature like a splash screen.

Regards,
Malcolm

----- Original message -----
From: "Tony Cappellini" <[email protected]>
To: [email protected]
Cc: [email protected]
Date: Mon, 22 Mar 2010 15:47:47 -0700
Subject: Re:Win API call to display a BMP/PNG file as a splash
screen for a console app?
From: [1][email protected]
To: "zz Python Win32 Newsgroup" <[2][email protected]>
Subject: [python-win32] Win API call to display a BMP/PNG file as
a
       splash screen for a console app?
Message-ID:
<[3][email protected]>
Content-Type: text/plain; charset="us-ascii"
>>Is there a Windows API call I can use to display a BMP or a PNG
>>file in a window centered on a user's display? This function
>>would be called from a console app to display a splash screen.
I don't know, but I suspect not.
>>complexity of a full GUI framework like wxPython or pyQT and
To do this in wxPython is approximately 10 lines of code, maybe
20 at the most.
Actually- the # of lines to do this in wxPython is less than your
original email.
class SketchApp(wx.App):
    def OnInit(self):
        bmp = wx.Image("splash.png").ConvertToBitmap()
        wx.SplashScreen(bmp, wx.SPLASH_CENTRE_ON_SCREEN |
wx.SPLASH_TIMEOUT,
                1000, None, -1)
        wx.Yield()
        frame = SketchFrame(None)
        frame.Show(True)
        self.SetTopWindow(frame)
        return True
if __name__ == '__main__':
    app = SketchApp(False)
    app.MainLoop()
This is barebones, taken from wxPython In Action- ideally you
should have some minimal exception handling
to make your app more robust.

References

1. mailto:[email protected]
2. mailto:[email protected]
3. mailto:[email protected]
_______________________________________________
python-win32 mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to